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

# re: Updated Outlook Macro for Creating Appointments

Tired of having to add the e-mail addresses to a meeting by drag & dropping the e-mail on the Calender, I very much enjoyed your article solving this problem. Implementing the macro I unfortunately found that Outlook 2003 has a new security feature in showing a display with:

"a program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this?"

and allowing a time window of 1,2 or 5 minutes. For the record: a selfcert certificate does not help in this case.

Luckily I found a simple solution to this browsing the internet by letting the macro not use a new instance of the outlook application object (thus triggering the security response), but using the outlook application object itself with results in a few changes in the VBA code which I hope you will adopt (after testing of course):

Replace

   ...

   Dim app as new outlook.application

   ...

By

   ...        

   Dim app As Outlook.Application

   Set app = Application

   ...

Cheers,

Arnoud Bergman

afbergman(at)zonnet.nl

Thursday, October 09, 2008 4:41 PM by Arnoud Bergman

# re: Updated Outlook Macro for Creating Appointments

hi there,

i'm looking for a different macro but i hope you could help me.

i'm trying to get my calendar better organized with all the meetings that i have. often i don't have time between meetings to either prepare for or even get from one meeting to another.

i would like to have a macro that automatically adds 15 minutes to each meeting at its beginnnig and/or end.

could anyone help me?

thanks,

evert

Thursday, October 30, 2008 2:10 AM by evert

# re: Updated Outlook Macro for Creating Appointments

I think you may be able to help me with something.  I would like a Gantt type display of an Outlook calendar.  I attempted to use Microsoft Project '07, but was unimpressed by its lack of connectivity and its oulandishly large tables.  Really if there is a way to print weekly calendars contiguously or monthly calendars with more than a few events showing, that would be great too.  If you have any suggestions or ideas, let me know at Michael "|)ot" Crone1 "@t" us "d0TT" army "d0t" mil

Any assisstance is appreciated, thanks!

Tuesday, December 02, 2008 12:47 PM by Michael Crone

# re: Updated Outlook Macro for Creating Appointments

This used to work on my computer, but it seems to have problems after an update that was pushed on me.

I am now getting a Run-time error 287 (Application-defined or object-defined error)

It is happening at the "meetingRequest.Body = email.Body" line in the main subroutine.

Any suggestions or thoughts as to why this is occurring?  

Much appreciated.

Mark

Wednesday, January 07, 2009 2:06 PM by Mark

# re: Updated Outlook Macro for Creating Appointments

Is there a way to create a macro and attach it to an outgoing message so that when the message arrives in the recipients Inbox an appointment is automatically created? What we are attempting to accomplish is to give every receipient of an upgrade email message a reminder to reboot their machine 3 days after receiving the email. We think that a macro attached to an outgoing mail message which runs as soon as the message is received may accomplish this. Thank you!

Friday, May 08, 2009 10:39 AM by Vince

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker