Programatticaly add people to Outlook appointment created by function 
Author Message
 Programatticaly add people to Outlook appointment created by function

I'm using a function that creates an Outlook appointment (code below;
adapted from MS KBase).  As I'm training users, they're asking if the
meeting participants they are selecting on the Access subform can be
transferred over as meeting participants in the Outlook appointment.  I'm
inclined to say no, but I thought I'd post this first.  The meeting
participants are added in a subform that uses a table of people.

Any thoughts?

Thanks!

Code:

Private Sub AddAppt_Click()
    On Error GoTo AddAppt_Err
         ' Save record first to be sure required fields are filled.
         DoCmd.RunCommand acCmdSaveRecord
         ' Exit the procedure if appointment has been added to Outlook.
         If Me!AddedToOutlook = True Then
            MsgBox "This appointment already added to Microsoft Outlook"
            Exit Sub
            ' Add a new appointment.
            Else
            Dim outobj As Outlook.Application
            Dim outappt As Outlook.AppointmentItem
            Set outobj = CreateObject("outlook.application")
            Set outappt = outobj.CreateItem(olAppointmentItem)
            With outappt
            .Start = Me!ApptDate & " " & Me!ApptTime
            .Duration = Me!ApptLength
            .Subject = Me!Appt
               If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
               If Not IsNull(Me!ApptLocation) Then .Location = _
                  Me!ApptLocation
                  If Me!ApptReminder Then
                  .ReminderMinutesBeforeStart = Me!ReminderMinutes
                  .ReminderSet = True
                  End If
                  outappt.Display
                  '.Save
            End With
            End If
         ' Release the Outlook object variable.
         Set outobj = Nothing
         ' Set the AddedToOutlook flag, save the record, display a message.
         Me!AddedToOutlook = True
         'DoCmd.RunCommand acCmdSaveRecord
         MsgBox "Appointment Added!"
         Exit Sub

AddAppt_Err:
         MsgBox "Error " & Err.Number & vbCrLf & Err.Description
         Exit Sub
End Sub



Mon, 30 Sep 2002 03:00:00 GMT  
 Programatticaly add people to Outlook appointment created by function
Stevan,

It's possible.  All you need to do is set the MeetingStatus property of the
AppointmentItem to olMeeting then add the invitees to the Recipients
collection in the same way you would for an e-mail addressed to the same
recipients.  The help topic "MeetingRequestItem" (Outlook 97) or
"MeetingItem Object" (Outlook 2000) should provide you with a sufficient
example to get you started.

HTH,
Nicole


Quote:
> I'm using a function that creates an Outlook appointment (code below;
> adapted from MS KBase).  As I'm training users, they're asking if the
> meeting participants they are selecting on the Access subform can be
> transferred over as meeting participants in the Outlook appointment.  I'm
> inclined to say no, but I thought I'd post this first.  The meeting
> participants are added in a subform that uses a table of people.

> Any thoughts?

> Thanks!

> Code:

> Private Sub AddAppt_Click()
>     On Error GoTo AddAppt_Err
>          ' Save record first to be sure required fields are filled.
>          DoCmd.RunCommand acCmdSaveRecord
>          ' Exit the procedure if appointment has been added to Outlook.
>          If Me!AddedToOutlook = True Then
>             MsgBox "This appointment already added to Microsoft Outlook"
>             Exit Sub
>             ' Add a new appointment.
>             Else
>             Dim outobj As Outlook.Application
>             Dim outappt As Outlook.AppointmentItem
>             Set outobj = CreateObject("outlook.application")
>             Set outappt = outobj.CreateItem(olAppointmentItem)
>             With outappt
>             .Start = Me!ApptDate & " " & Me!ApptTime
>             .Duration = Me!ApptLength
>             .Subject = Me!Appt
>                If Not IsNull(Me!ApptNotes) Then .Body = Me!ApptNotes
>                If Not IsNull(Me!ApptLocation) Then .Location = _
>                   Me!ApptLocation
>                   If Me!ApptReminder Then
>                   .ReminderMinutesBeforeStart = Me!ReminderMinutes
>                   .ReminderSet = True
>                   End If
>                   outappt.Display
>                   '.Save
>             End With
>             End If
>          ' Release the Outlook object variable.
>          Set outobj = Nothing
>          ' Set the AddedToOutlook flag, save the record, display a
message.
>          Me!AddedToOutlook = True
>          'DoCmd.RunCommand acCmdSaveRecord
>          MsgBox "Appointment Added!"
>          Exit Sub

> AddAppt_Err:
>          MsgBox "Error " & Err.Number & vbCrLf & Err.Description
>          Exit Sub
> End Sub



Mon, 30 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Add Appointment to Outlook from Access

2. Need VBA to add Appointment to Outlook XP

3. Add Appointment to Outlook from Website

4. Adding an Appointment to Outlook via VbScript

5. Creating a new appointment outside of Outlook...

6. Using Word VBA to Create Appointment Items in Outlook

7. Create an appointment in Outlook using MAPI

8. Creating Outlook appointments w/Visual Basic

9. Creating Outlook Calendar Appointments via MAPI mail

10. creating an appointment in Pocket Outlook via EVB

11. create an add/modify/delete appointment event handler

12. Appointment additions to other people's calendar

 

 
Powered by phpBB® Forum Software