I've written a simple function to post an appointment in vba (ms access) and it works fine on my groupwise calendar but I need to post it to a calendar that I have proxy access to.

I'm new to this API, so detailed instructions in vba would be appreciated. My function is below.

Thanks in advance!

Function GWPostApp(appDate As String, appDuration As Integer, appSubject As String, appVenue As String, appBody As String)

    Dim objGWApp As Application2
    Dim objGWAccount As Account2
    'Create and login to the application object.
    Set objGWApp = New Application2
    'Log in to a new mailbox object using the application object
    Set objGWAccount = objGWApp.Login
    'Add a new message/task object to the calendar.
    Set objGWTask = objGWAccount.Calendar.Messages.Add("GW.MESSAGE.APPOINTMENT", egwPersonal)
    'Set Appointment Properties
    With objGWTask
        .StartDate = appDate
        .Duration = appDuration / 24
        .Subject = appSubject
        .Place = appVenue
        .OnCalendar = True
        .BusyType = egwBlocked
        .BodyText = appBody
        .NotifyWhenDeleted = 0
    End With

    MsgBox "Appointment Successfully Posted!"
    'Clear up the objects
    Set objGWTask = Nothing
    Set objGWAccount = Nothing
    Set objGWApp = Nothing

End Function