Results 1 to 4 of 4
  1. #1
    dragonfly is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2011
    Posts
    5

    Question Create Outlook Meeting Invitation from Access on behalf of a delegate

    Hi! I need to create a meeting invitation in Outlook 2010 from Access but I need it to be sent on behalf of someone else.

    Here's the example - Mary is the primary user of the database and she has rights to create meeting invitations from the group calendar "TEAM CALENDAR". The group calendar has it's own Exchange Account and Mary has been set up as a delegate to send invitations on behalf of the TEAM CALENDAR.

    I've created the following code that works successfully to pull values from a form and create an invitation. What I can't do is use the "From" button in the calendar to choose who to send the invitation from. I need the invitation to come from the TEAM CALENDAR and save to that calendar and not to Mary's personal calendar.

    Thank you so much for taking the time to read this thread. Your assistance is greatly appreciated.

    Below is my code:
    Private Sub cmdSendInvitation_Click()


    Dim outobj As Outlook.Application
    Dim outappt As Outlook.AppointmentItem
    Set outobj = CreateObject("outlook.Application")
    Set outappt = outobj.CreateItem(olAppointmentItem)

    On Error GoTo AddAppt_Err



    With outappt
    .Start = Me.CourseDate & " " & Me.ClassStartEnd
    .Duration = Me.Duration
    .Subject = "Date Requested: " & Me.CourseTitle
    .MeetingStatus = olMeeting
    .RequiredAttendees = Me.Personalemail
    .Display
    .Location = Me.Location
    .Body = "Course Date: " & [Course Date] & vbCrLf & "Course Title: " & [Course Title] & vbCrLf & "Location: " & [CourseLocation] & vbCrLf & "Trainer Role: " & "Comments: " & Me.Comments
    End With
    Set outobj = Nothing
    Exit Sub

    AddAppt_Err:
    If Err.Number = 94 Then
    MsgBox ("You are missing either the Course Date, Class Length or Duration information. Please close this window, edit the schedule and try again")
    End If
    Exit Sub

    End Sub

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I do not have a delegate in the Outlook application in front of me. IIRC, a delegate will appear in the Outlook application as an account. I would probably try to go after the specific account and instantiate an object for that account name. Not quite sure how to go about that though ...

    You might try going after the MAPI Layer. Here is an example of using the Session object within the MAPI layer.
    Code:
     Dim account As Outlook.MAPIFolder
     Set account = Session.Folders("NameOfPST_File")   'The name of the account's PST file or Exchange account. Default is Outlook
    https://www.accessforums.net/access/...tml#post285959

    Now the problem is how to CreateObject for that Account. I am not sure the MAPI folder is the way to go but I would start there. Hope this helps. Oh, I would add that when you CreateObject like this
    Code:
    Set outappt = outobj.CreateItem(olAppointmentItem)
    you are going after the first account in the Client Application. There may be a way to go after another account. Maybe discover the ordinal position of the desired account or go after a name property.



    .

  3. #3
    dragonfly is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    5
    Thank you! I'll look into your suggestion. The TEAM CALENDAR Account doesn't actually show as an Account in the account settings dialog box - does that matter? I was hoping to be able to use the organizer name somehow to create this but just can't get it to work.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by dragonfly View Post
    ...The TEAM CALENDAR Account doesn't actually show as an Account in the account settings dialog box - does that matter?...
    Yes, the MAPI folders collection will include the names listed under account settings. There are other folders within the collection. For instance, there are folders representing contacts, suggested contacts, and others that do not appear in GUI dialog boxes.

    I am trying to recall how the delegate is set up in the client. I thought you create an account in your Outlook Client that is dedicated as a delegate. IIRC, when you create a delegate in Exchange Server, you create an account. For instance, Joe Blow would be a new account. Then, you give Joe Blow delegate rights to another account. Maybe you can start with getting all of the names within the Account Settings dialog box.

    EDIT:
    Maybe the account is just a Calendar in Exchange server.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. can I create/update an Outlook email group from my Access data?
    By jimdharris in forum Import/Export Data
    Replies: 2
    Last Post: 08-31-2015, 10:07 AM
  2. Making access create a task in Outlook
    By lixolin in forum Programming
    Replies: 4
    Last Post: 11-12-2013, 02:43 AM
  3. Replies: 1
    Last Post: 05-31-2013, 02:04 AM
  4. Replies: 20
    Last Post: 06-27-2012, 02:19 PM

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
  •  
Other Forums: Microsoft Office Forums