>> Trap message

  • Thread starter Thread starter Jonathan
  • Start date Start date
J

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
 
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:
 
Back
Top