07-23-2009, 05:05 AM
Is it possible to handle Outlook 2003 VBA events in QM?
When a message is sent (arrives in the Outlook Sent Items folder) I would like QM to print the message and move it to one of several mail folders.
This page, http://www.outlookcode.com/article.aspx?id=62, discusses some options for processing messages when they arrive in Outlook, including "Method 2: Using the Items.ItemAdd event", which could be used with the Sent Items folder.
Could the example code (copied below) be implemented in QM so that QM could handle the ItemAdd event when new items arrive in the Inbox or Sent Items folders?
Thanks in advance,
John
Sample code for: Method 2: Using the Items.ItemAdd event
When a message is sent (arrives in the Outlook Sent Items folder) I would like QM to print the message and move it to one of several mail folders.
This page, http://www.outlookcode.com/article.aspx?id=62, discusses some options for processing messages when they arrive in Outlook, including "Method 2: Using the Items.ItemAdd event", which could be used with the Sent Items folder.
Could the example code (copied below) be implemented in QM so that QM could handle the ItemAdd event when new items arrive in the Inbox or Sent Items folders?
Thanks in advance,
John
Sample code for: Method 2: Using the Items.ItemAdd event
Option Explicit
Private WithEvents olInboxItems As Items
Private Sub Application_Startup()
Dim objNS As NameSpace
Set objNS = Application.Session
' instantiate objects declared WithEvents
Set olInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
Set objNS = Nothing
End Sub
Private Sub olInboxItems_ItemAdd(ByVal Item As Object)
On Error Resume Next
Item.BodyFormat = olFormatPlain
Item.Save
Set Item = Nothing
End Sub