Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2006
    Posts
    6

    Unanswered: Access 2010 VBA to create calendar appointment in shared calendar

    Hi Guys
    I have written some VBA in Access 2010 to create a calendar appointment in Outlook 2010. I have got it working okay (apart from text size which I have posted as a separate question).
    It is putting it in my personal calendar but I also have access to a shared team calendar called 'Brokerage' and I would prefer the calendar appointment to go in there.
    I have spent ages trying to google this but haven't come up with anything that I could use or understand.
    I am self-taught in VBA so not that technical but can usually pick things up reasonable quickly. Any help would be much appreciated.

    This is my code:

    '-------------------------
    'Send calendar invitation
    '-------------------------

    'GoTo Skip_CalendarInvite

    InviteBody = "This is to remind you that you are booked to attend the above training course. " & vbCrLf
    InviteBody = InviteBody & "If you are unable to attend this course, you MUST inform us by emailing "
    InviteBody = InviteBody & CalendarFrom & " "
    InviteBody = InviteBody & "to advise us you can no longer attend. " & vbCrLf & vbCrLf
    InviteBody = InviteBody & "This calendar invite is for your information only and we DO NOT monitor Accept/Decline calendar invite responses. " & vbCrLf & vbCrLf
    InviteBody = InviteBody & "You may wish to change the status of this calendar entry to busy."

    Set outInvite = Outlook.CreateItem(olAppointmentItem)
    outInvite.MeetingStatus = olMeeting
    outInvite.Subject = Me.CourseName
    outInvite.Importance = 2 ' high
    outInvite.BusyStatus = 0 ' free (you don't want your own calendar to show tentative or busy)
    outInvite.Location = Me.Venue
    outInvite.Start = Me.StartDate & " " & Me.StartTime
    outInvite.End = Me.StartDate & " " & Me.EndTime
    outInvite.RequiredAttendees = InviteList
    outInvite.Body = InviteBody
    outInvite.ResponseRequested = False
    outInvite.ReminderMinutesBeforeStart = 1440
    outInvite.Send 'Uncomment if you want invitations sent immediately, rather than just setting up (but not sending)a new meeting request in your calendar
    'outInvite.Save 'Uncomment if you want message saved to your sent items folder

    Set outInvite = Nothing
    ConfirmMsg = "Emails and Calendar Invites have been created but not sent."


    Skip_CalendarInvite:

  2. #2
    Join Date
    Jun 2006
    Posts
    6
    Problem solved.

    I added the following code:

    Set olfolder = ouApp.GetNamespace("MAPI").PickFolder

    Set outInvite = olfolder.Items.Add




    This displays the Outlook folder listing and then I can just select the calendar I want the appointment to go into.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •