A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How do I link outlook events to Word being used as email editor?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 27th 07, 06:05 PM posted to microsoft.public.outlook.program_vba
Graybane
external usenet poster
 
Posts: 2
Default How do I link outlook events to Word being used as email editor?


  #2  
Old February 28th 07, 07:05 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How do I link outlook events to Word being used as email editor?



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  
Old February 28th 07, 03:06 PM posted to microsoft.public.outlook.program_vba
Graybane
external usenet poster
 
Posts: 2
Default How do I link outlook events to Word being used as email edito

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 07:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.