开发者

Is there a way to programmatically grab a list of meeting attendees from Outlook?

I am trying to grab a list of meeting attendees from Outlook 2003. I am open to using any language that would be appropriate. Scripting languages are preferable. A开发者_如何学Gony suggestions?


The information is exposed through the outlook COM interface so any language that can talk COM would work fine.

I once wrote a piece of code that did just this (and some more), and you can see the source yourself.

If you can't be bothered to look through that code, in a nutshell you do:

// Also, don't forget to add a project reference to the outlook COM object
using Microsoft.Office.Interop.Outlook;

...

var outlookNS = OutlookApp.GetNamespace("MAPI");
var calendar = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);

foreach (AppointmentItem item in calendar.Items)
{
    // Mandatory attendees (in the "To:" field)
    foreach (var attendee in item.Recipents)
      Console.WriteLine("Attendee {0}", attendee);

    // Optional Attendees (in the "CC:" field)
    foreach (var attendee in item.OptionalAttendees)
      Console.WriteLine("Attendee {0}", attendee);
}


In perl you would use Win32::OLE.

See for examle this link and of course the documentation that comes with that module.

You should also be able to simply rewrite the VB code given above to perl using Win32::OLE.

And also see this other question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜