Calendar Macro

Status
Not open for further replies.
Got it. Just so you know I already have the getcurrentitem function...so don' need it..I read the following re if a conact is open...

When you are looking at an item that is open and has focus, it uses an

Outlook Inspector. The code you need to work with Inspectors is:


[TD="class: code"]Set objItem = objApp.ActiveInspector.CurrentItem

If that is what needs to be added, where do I put it re the code below that creates the calendar event etc...and anything else to add:

Sub Office_Calendar_Event()
Set myFolder = Session.GetDefaultFolder(olFolderCalendar).Folders ("Office Calendar")
Set myItem = myFolder.Items.Add("IPM.Appointment.Office Calendar Event")
myItem.Display
End Sub


[/TD]

 
The following is the code that works to create a calendar event from a contact and in the contact I have the Start and Time controls where I create the date and time and it creates it on the calendar event....But, the controls that I use on the contact, do not save the date and time to the controls on the contact....so is there way to make that happen?

Sub btnAddCalendarEvent_Click

dim ContactName

dim olns

dim MyFolder

dim NumItems

dim myItems

Dim StartDateTime

Dim EndDateTime

Dim itmAppt

ContactName = Item.GetInspector.ModifiedFormPages("General").Controls("Fullname").value

Set olns = Item.Application.GetNameSpace("MAPI")

Set myfolder = Session.GetDefaultFolder(9).Folders(2)

Set itmAppt = myfolder.Items.Add("IPM.Appointment.Office Calendar Event")

itmAppt.Subject = ContactName & " - " & item.getinspector.modifiedformpages("General").controls("combobox11").text

itmAppt.Location = item.getinspector.modifiedformpages("General").controls("combobox12").text

StartDateTime = item.getinspector.modifiedformpages("General").controls("OlkDateControl1").value & " " & item.getinspector.modifiedformpages("General").controls("OlkTimeControl1").value

itmAppt.Start = StartDateTime

EndDateTime = item.getinspector.modifiedformpages("General").controls("OlkDateControl2").value & " " & item.getinspector.modifiedformpages("General").controls("OlkTimeControl2").value

itmAppt.End = EndDateTime

itmAppt.links.add item

itmappt.display

End Sub
 
Per above post, I found way to fix it.....nothing else re this..
 
Not me....it comes from a technical person in Houston, Texas......PS, did you find the way to put in the second note field to a contact form where they are both visable and work separately?
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
H Macro to Delete Duplicate items in Outlook calendar where title is the same and date is the same Outlook VBA and Custom Forms 0
G Creating Macro to scrape emails from calendar invite body Outlook VBA and Custom Forms 6
J Macro to Insert a Calendar Outlook VBA and Custom Forms 8
U Macro for reminders,tasks,calendar Outlook VBA and Custom Forms 4
E Help with macro to answer and delete calendar requests? Outlook VBA and Custom Forms 5
W Add to Calendar links - auto accept with macro Using Outlook 1
N How Can I create an Outlook Macro to import calendar? Outlook VBA and Custom Forms 1
S Outlook 365 Outlook (classic) Calendar Peek not showing iCloud calendar events Using Outlook 4
P Outlook Calendar entry being used as malware vector. Using Outlook 4
P ics calendar entries suddenly open up new Outlook Using Outlook 3
G Forms error on iCloud calendar Using Outlook 18
V select default calendar Outlook VBA and Custom Forms 3
I Outlook 2024 LTSC syncing with iCloud calendar - can only make appt. in iCloud Using Outlook 2
I Cant delete an appointment in Calendar Using Outlook 2
S Missing categories in Outlook calendar Using Outlook 10
M Calendar items have a pale pink blushing Using Outlook 3
P Windows 11/Office 365 - can't forward calendar entry as ics file Using Outlook 3
O How to share calendar categories? Using Outlook 4
T Cannot delete a calendar Using Outlook 0
A OL24 Calendar folder pane too narrow Using Outlook 9
F Sync Outlook Calendar Using Outlook 0
F Show events in Monthly Calendar Using Outlook 3
E Subscribing to another calendar when each party uses Office 365 Family Using Outlook 3
M Retaining old contacts and calendar in new account setup Using Outlook 6
P Email and calendar entry text now shifts right about 3 tabs worth of space Using Outlook 1
N Best way to sync calendar and contacts between Outlook 365 and Outlook on iPhone Using Outlook 4
J Emails with .ICS calendar invitations attached don't contents when received in Outlook 365 Using Outlook 6
O Any 3rd party tool that sync (mirror) from Outlook Calendar to Google Calendar? Using Outlook 5
Fozzie Bear Calendar Events created on iPhone have suddenly start sending invitations to attendees Using Outlook 2
J Set calendar default to 'none' (policy) Exchange Server Administration 3
J Calendar events created on iPhone automatically changing default alert from 'None' to 'Time of Event' Using Outlook.com accounts in Outlook 0
G Outlook 365 My iCloud Outlook doesn’t work after reinstalling Microsoft365 on Windows 10 PC – now I get error message on contacts and calendar Using Outlook 1
U When opening shared Calendar "The set of folders cannot be opened" Using Outlook 0
P Can no longer sync Outlook with iPhone calendar after iPhone update to 17.1.1 Using Outlook 7
P turn off the default "all day" check box in new calendar items. How? Using Outlook 1
A Outlook 365 New Appointments All saved to a 365 default calendar on Mac Using Outlook 0
V Unchecking my calendar and leaving shared one visible Outlook VBA and Custom Forms 1
V VBA Categories unrelated to visible calendar and Visual appointment Categories Outlook VBA and Custom Forms 2
M New Calendar Appointments: Conditionally turn off reminder and show time as free Using Outlook 14
J Cannot edit a calendar event received as an invitation Using Outlook 2
H Outlook 365 O365 outlook calendar item editing Using Outlook 1
Kika Melo Outlook Calendar deleted appointments not in Deleted Items folder Using Outlook 3
P Copying ALL calendar entries from Calender in PST file to IMAP OST file? Using Outlook 1
e_a_g_l_e_p_i Question about calendar Using Outlook 5
icacream Outlook 2021 - Google calendar in the peek Using Outlook 0
e_a_g_l_e_p_i MY Outlook 2021 changed the format of the shortcuts for mail, calendar etc. Using Outlook 10
Fozzie Bear Shared Calendar For Scheduled Tasks Using Outlook.com accounts in Outlook 3
K Add an entry to a specific calendar Using Outlook 1
F Add a category before "Send an Email When You Add an Appointment to Your Calendar" Outlook VBA and Custom Forms 0
L Synch Outlook 365 calendar with iPhone Using Outlook 0

Similar threads

Back
Top