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

Trap message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 6th 08, 01:19 AM posted to microsoft.public.outlook.program_vba
Jonathan
external usenet poster
 
Posts: 49
Default Trap message

Hi, If I create a message in Outlook I can successfully use
ThisOutlookSession.Application_ItemSend event to check the subject of a sent
message item (for logging). The problem is messages created in MS Access and
displayed to give the user an opportunity to edit, do not trigger this event
when sent (want to log message after user has made changes).

Is there some way for me to ensure that this event is activated?

Alternatively, in my Access routine I have the line
olEmailMessage.Display True
to display the message. When stepping through the code the next line is not
executed until the user actually sends the displayed message. I was hoping to
use the reference to the message item at this point. However, the system
returns a message to say that the item has been moved or deleted.

How do I maintain the reference to the message item once it has been sent?

Any ideas or suggestions appreciated :-)

Many thanks,
Jonathan
Ads
  #2  
Old June 6th 08, 06:46 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Trap message



You can use the same events in Access if you use the Outlook object model.
Just declare the object variable WithEvents:

Private WithEvents m_OutlookApp as Outlook.Application

Now you can select the object's events like you would do in Outlook.

If you display the email with .Display True, it gets displayed modal, i.e.
the code execution is wainting until you close the window. Call it with
False if you don't want it to stop.

--
Best regards
Michael Bauer - MVP Outlook

: VBOffice Reporter for Data Analysis & Reporting
: Outlook Categories? Category Manager Is Your Tool:
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Thu, 5 Jun 2008 17:19:00 -0700 schrieb Jonathan:

Hi, If I create a message in Outlook I can successfully use
ThisOutlookSession.Application_ItemSend event to check the subject of a

sent
message item (for logging). The problem is messages created in MS Access

and
displayed to give the user an opportunity to edit, do not trigger this

event
when sent (want to log message after user has made changes).

Is there some way for me to ensure that this event is activated?

Alternatively, in my Access routine I have the line
olEmailMessage.Display True
to display the message. When stepping through the code the next line is

not
executed until the user actually sends the displayed message. I was hoping

to
use the reference to the message item at this point. However, the system
returns a message to say that the item has been moved or deleted.

How do I maintain the reference to the message item once it has been sent?

Any ideas or suggestions appreciated :-)

Many thanks,
Jonathan

 




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
MSG File - Trap Explorer Selection Change Event DG Outlook and VBA 8 January 11th 10 09:03 AM
Trap the MailItem.Reply Event Naji Outlook - Using Forms 1 April 10th 08 03:00 PM
Outlook 2007 e-mail message headers download but not message body DJR Outlook - Installation 3 September 13th 06 03:00 AM
Trap reply event SuperSlueth Outlook - Using Forms 1 February 13th 06 09:09 PM
Trap Reply Event technoloG Add-ins for Outlook 4 January 18th 06 10:08 PM


All times are GMT +1. The time now is 06:23 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.