PDA

View Full Version : Macro: Calendar event as New Email (no attachment)



gregw74
09-25-2008, 05:46 AM
I appreciate anyone who might be able to help me with a little macro that would be a huge help for me.

I would just like to convert any calendar event into a new email message (text only). Currently if a calendar event is forwarded from Outlook (2003), the event is included as an attachment. I need the calendar event and it's various details to be included in the body of a plain text email, no attachment.

Thank you!!
Greg

Demosthine
10-01-2008, 05:26 PM
Good Afternoon.

How much coding do you have for this project so far? From the sounds of it, you don't have anything.

Now, there are several questions I have for helping you with the final version.

Are all of the emails going to the same address?
Are you wanting one calendar item per email or them merged into a single email?
Do you need to filter the calendar down to certain date ranges or are you really taking the entire calendar to mail out?


Now, for the basics of the project, I'll lay out a plan for you.
01.) You need to define an Object that allows you to access the Calendar Folder. You do this by creating an Object of type MAPIFolder and set it using the GetDefaultFolder Function of the Sessoin Object.

02.) If you are not wanting to send the entire email, you may filter the results down to another Object of type MAPIFolder using the above Object's Restrict Function. This utilizes a filter string that defines what to filter.

03.) Next, we'll run a For Each loop using each CalendarItem in your filtered Object.

04.) With each iteration of the above loop, you will be able to extract whatever information you need, such as the Start Time and End Time, Location, Subject, and Body.

05.) Depending on whether you want a single message or multiple messages, you can compose and send the email within the loop or outside of the loop.


Hope this gets you going.
Scott