VBA Outlook Change Dir / Calendar

it would be great if one of you could share how to change the dir outlook via VBA code.
all i need to do is go from one users calendar to another and post an apointment. ive gotten down how to post, but no matter what i try i cant get it into another users acount. i am able to do this by opening the calendar and changeing it manualy.
is it possible to do this in "ThisCurrentSession" in VBA or do i have to use an anonmous MAPI sign in through exchange?

Comments

  • : it would be great if one of you could share how to change the dir outlook via VBA code.
    : all i need to do is go from one users calendar to another and post an apointment. ive gotten down how to post, but no matter what i try i cant get it into another users acount. i am able to do this by opening the calendar and changeing it manualy.
    : is it possible to do this in "ThisCurrentSession" in VBA or do i have to use an anonmous MAPI sign in through exchange?
    :

    Wow, after a week of searching i descovered how.

    Private Sub cmdGo_Click()
    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    Set myRecipient = myNameSpace.CreateRecipient("Ed McMan")
    Set hisCalendar = myNameSpace.GetSharedDefaultFolder(myRecipient, olFolderCalendar)
    Dim A As AppointmentItem
    Set A = CreateItem(olAppointmentItem)
    A.Subject = "Test Event - " & txtCase
    A.Start = txtDate
    A.End = txtDate
    A.Duration = 60
    A.AllDayEvent = True 'must have a duration
    A.Save
    A.Move hisCalendar
    End Sub

    lol, i hope i help someone else out there with this porblem.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion