none
Outlook Calendar Form Macro RRS feed

  • General discussion

  • I have learned the following code that is put in the ThisOutlookSessionArea of the VBA and as a macro and a shortut to it, it creates a appointment to the other calendar I use which the name is "Office Calendar".  And on the Office Calendar, I created a new appointment and published it as the name "Office Calendar Event".   So when I open a contact, and run the macro it creates an appointment to the calendar I want to use, but it does not add the link the contact.

    Recently, Eric gave me the code line of "myItem.Links.Add Item" which I added to another code to link the contact I was working from, but his line does not do it in the following code for the calendar.

    So does anyone know what to add so it links the appointment to the contact I run the macro from?  Thanks much to all.

    Here is the code that works so far without the code line re the contact link:

    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

    Sunday, July 14, 2013 6:15 AM

All replies

  • I received the following code and error as follows, so does anyone know how fix this code?

    Tthe error is "Ambiguous name detected: GetCurrrentItem

    Here is the code and is there anything to try to fix please:

    Sub Office_Calendar_Event()
    Set oContact = GetCurrentItem()
    Set myFolder = Session.GetDefaultFolder(olFolderCalendar).Folders ("Office Calendar")
    Set myItem = myFolder.Items.Add("IPM.Appointment.Office Calendar Event")
    myItem.Links.Add oContact.FullName
    myItem.Display
    End Sub
    Wednesday, July 17, 2013 12:36 AM