E-mail address of the meeting organizer

  • Thread starter Joacim Andersson [MVP - VB]
  • Start date
J

Joacim Andersson [MVP - VB]

Thank you so much Sue, you're a lifesaver!!!
I'm downloading Outlook Spy right now.

Thanks to Roady as well for the information about the correct forums.

/Joacim
 
J

Joacim Andersson [MVP - VB]

Hi all,

I don't know if this is the correct news group for this question, if it
isn't please inform me.

What I need to do is to programmatically get the e-mail address of a meeting
organizer. I'm using VSTO and Outlook 2007. Below is a some sample code
similar to what I'm using, I get all AppointmentItems for the current week.
If any of these is a meeting I need to get the e-mail address of the
organizer, but all I get is the name. There doesn't seem to be any way to
convert an AppointmentItem into a MeetingItem, but Outlook itself have no
problem showing the information I need if I manually double click the
appointment in the calendar.

Dim folder =
CType(Globals.ThisAddIn.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar),
Outlook.Folder)
Dim monday = DateAdd(DateInterval.Day, -(Weekday(DateTime.Today,
FirstDayOfWeek.Monday) - 1), DateTime.Today)
Dim items = From item In folder.Items _
Select item = CType(item, Outlook.AppointmentItem) _
Where (item.Start >= monday AndAlso item.Start <
DateAdd(DateInterval.Day, 6, monday))
For Each itm In items
If itm.MeetingStatus <> Outlook.OlMeetingStatus.olNonMeeting Then
'This is a meeting, so how can I get the e-mail address of the
organizer
End If
Next

Are anyone here enough familiar with the Outlook object model to give me any
hint in the correct direction?

Cheers,

Joacim
 
R

Roady [MVP]

It's better to post this question in a developers newsgroup down the hall.
outlook.program_addins
outlook.program_vba

Good luck!
 
S

Sue Mosher [MVP]

As Roady said, this isn't the right forum for programming questions, but I've
crossposted to the correct forum so followups can continue there.

To get the sender address or any other property that is not exposed in the
Outlook object model, use the PropertyAccessor object, e.g.:

Set objAppt = <some expression that returns an AppointmentItem>
Set pa = objAppt.PropertyAccessor
senderaddy = pa.GetProperty("urn:schemas:httpmail:fromemail")

How can you learn the names of MAPI properties for use with the
PropertyAccessor object? I usually look them up with the Outlook Spy or
MFCMAPI.exe tool. That's easier than trying to wade through the MSDN
documentation. Every Outlook developer should have one tool or the other.
 

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