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
....