Welcome to MSDN Blogs Sign in | Join | Help

Updated Outlook Macro for Creating Appointments

Last year I created a simple macro for Microsoft Outlook 2007 that automatically created an appointment from an email, adding the recipients to the appointment invite.  Apparently there has been quite a bit of interest in this, most recently someone asked if it could be modified so that it would work with the previewed email in addition to an opened email.  Well I looked at the code again and found that it was pretty easy to do: 

If the active inspector is null, then no item is opened.  I then check to see if the preview pane is visible and if it is, I get the first selected item (because only the first item is previewed). 

I have attached the updated source code for your use and productivity.  Thanks for all of your suggestions!

    ...
Dim app As New Outlook.Application Dim item As Object If app.ActiveInspector Is Nothing Then If app.ActiveExplorer.IsPaneVisible(olPreview) Then Set item = app.ActiveExplorer.Selection.item(1) End If Else Set item = app.ActiveInspector.CurrentItem End If If item Is Nothing Then Exit Sub If item.Class <> olMail Then Exit Sub
....
Published Wednesday, April 23, 2008 4:59 PM by Michael S. Scherotter
Filed under: , ,

Attachment(s): NewMeetingRequestFromEmail.bas

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Microsoft news and tips &raquo; Updated Outlook Macro for Creating Appointments

# re: Updated Outlook Macro for Creating Appointments

Hey there, I was the bloke interested in having it done from the preview pane. And woaw, that was done quickly. Indeed, it works like a charm.

Thanks a lot! :D

Thursday, April 24, 2008 2:03 AM by James

# re: Updated Outlook Macro for Creating Appointments

Here is something we are working on. We are using your code (thank you) but want a rule to create a calendar event. We have found how to do this but your code and the above code need to have a window open or have a preview. What if you don't need or want to see the email.

What happens is that a helpline sends an email to me saying I have a call and need to contact the client. I then have to create a calendar event for this. It would be nice if a rule could grab the info out of the email and create the calendar event for me. Saves me some time.

Can this be done or does a active window need to be open?

Friday, May 30, 2008 5:03 PM by Derek Blair

# re: Updated Outlook Macro for Creating Appointments

A programmer friend helped me out. I am almost there.

Friday, May 30, 2008 5:33 PM by Derek Blair

# re: Updated Outlook Macro for Creating Appointments

in office2007 it is enaught to drag & drop mail to Calendar or task. Drag with right button for more options

Sunday, July 20, 2008 11:07 AM by Vele

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker