![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]() |
#2
|
|||
|
|||
![]() You have to declare the variable for the object that sends the events With Events. For that you must add a reference to Outlook to your Word project via Tools/References. Sample: Private WithEvents m_Mail as Outlook.MailItem Now you can choose m_Mail in the left combobox (right above the code window) and then its several events from the right one. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Keep your Outlook categories organized! http://www.shareit.com/product.html?...4&languageid=1 (German: http://www.VBOffice.net/product.html?pub=6) Am Tue, 27 Feb 2007 09:05:05 -0800 schrieb Graybane: |
#3
|
|||
|
|||
![]()
Mike, Thanks for your reply. I have done everything you have stated and the
event is not firing. I have a structure wrong. I have included the code structures that I am using. I should say that everything is tied to Normal.dot and Document1 has a reference to Normal. Word Mail editor with Outlook 11.0 reference set and Normal.dot being picked up Created Class Module MyClass Option Explicit Public WithEvents OutlookMail As Outlook.Application Public WithEvents OutlookMailNS As NameSpace Public WithEvents OutlookMailInspector As Outlook.Inspectors Public WithEvents OutlookMailItem As Outlook.MailItem Public Sub OutlookMailInspector_NewInspector(ByVal Inspector As Outlook.Inspector) Dim MySubject As String MySubject = "***Alert*** Reports Error" Set OutlookMail = CreateObject("Outlook.Application") Set OutlookMailNS = OutlookMail.GetNamespace("MAPI") Set OutlookMailInspector = OutlookMail.Inspectors Set OutlookMailItem = OutlookMail.CreateItem(OlItemType.olMailItem) If OutlookMailItem.Subject = MySubject Then 'Some tasks.......... End If End Sub Created Module Module1 Option Explicit Public MC As New MyClass Sub Register_Event_Handler() Set MC.OutlookMailInspector = CreateObject("Outlook.Inspectors") Set MC.OutlookMail = CreateObject("Outlook.Application") Set MC.OutlookMailNS = QC.OutlookMail.GetNamespace("MAPI") Set MC.OutlookMailInspector = Outlook.Inspectors Set MC.OutlookMailItem = QC.OutlookMail.ActiveInspector.CurrentItem End Sub "Michael Bauer [MVP - Outlook]" wrote: You have to declare the variable for the object that sends the events With Events. For that you must add a reference to Outlook to your Word project via Tools/References. Sample: Private WithEvents m_Mail as Outlook.MailItem Now you can choose m_Mail in the left combobox (right above the code window) and then its several events from the right one. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Keep your Outlook categories organized! http://www.shareit.com/product.html?...4&languageid=1 (German: http://www.VBOffice.net/product.html?pub=6) Am Tue, 27 Feb 2007 09:05:05 -0800 schrieb Graybane: |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word as my email editor | d.hoffman | Outlook - General Queries | 3 | December 1st 06 07:04 PM |
Word as email editor | Sudhirb | Outlook - Installation | 1 | November 4th 06 10:35 PM |
How to add a picture to an Outlook 2002 signature, without using 'Word as email editor' | [email protected] | Outlook - General Queries | 0 | October 6th 06 05:05 PM |
can't find word as email editor in outlook | Debbie | Outlook - Installation | 2 | October 5th 06 03:13 PM |
Use 3rd Party Editor in Outlook not Word or Built in Editor | Charles | Outlook - Installation | 1 | March 28th 06 04:32 PM |