Outlook 2007: Show attendees dialog with vba

M

Marc M.

Hello,

i hope someone can help me.
My problem is to generate an appointment in outlook with attendees.

My code is the following:


++++++++++++
Dim Outlook As New Outlook.Application

Dim Folder As Outlook.MAPIFolder
Set Folder = Application.Session.Folders("Öffentliche
Ordner").Folders("Alle Öffentlichen Ordner").Folders("Kalender")


Dim objTermin As Outlook.AppointmentItem

Set objTermin = Folder.Items.Add

With objTermin
.Recipients.Add ("(e-mail address removed)")
.Subject = "BetreffText"
.Body = "BodyText"
.Location = "OrtText"
.Start = Now
.End = Now + 1
.BusyStatus = 2
.ReminderSet = False
.Close 1
.Display
End With

objTermin.Display
++++++++++++

The problem is here, that the entry is correctly shown, but the
attendees dialog is not visible immediately.
I also have to manually press the button "invite attendee".
Am I able to activate the dialog with the vb code?

Thanks in advance.

Greetings
Marc
 
K

Ken Slovak - [MVP - Outlook]

For Outlook 2007 you can execute the ribbon control for Invite Attendees to
produce the effect you want of the dialog opening. What you have to do is
get the Inspector for your item (objTermin.GetInspector) and get the
Inspector.CommandBars collection. Then you can call the ExecuteMso method on
the CommandBars object. The idMso for the control would be
"InviteAttendees", so the code would look something like this:

' other code

Dim colCB As Office.CommandBars
Dim oInsp As Outlook.Inspector

objTermin.Display

Set oInsp = objTermin.GetInspector
Set colCB = oInsp.CommandBars
colCB.ExecuteMso("InviteAttendees")




Hello,

i hope someone can help me.
My problem is to generate an appointment in outlook with attendees.

My code is the following:


++++++++++++
Dim Outlook As New Outlook.Application

Dim Folder As Outlook.MAPIFolder
Set Folder = Application.Session.Folders("Öffentliche
Ordner").Folders("Alle Öffentlichen Ordner").Folders("Kalender")


Dim objTermin As Outlook.AppointmentItem

Set objTermin = Folder.Items.Add

With objTermin
.Recipients.Add ("(e-mail address removed)")
.Subject = "BetreffText"
.Body = "BodyText"
.Location = "OrtText"
.Start = Now
.End = Now + 1
.BusyStatus = 2
.ReminderSet = False
.Close 1
.Display
End With

objTermin.Display
++++++++++++

The problem is here, that the entry is correctly shown, but the
attendees dialog is not visible immediately.
I also have to manually press the button "invite attendee".
Am I able to activate the dialog with the vb code?

Thanks in advance.

Greetings
Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top