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

Set off VBA macro on email receipt then that macro accesses the emailcontent



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 4th 09, 07:51 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 4
Default Set off VBA macro on email receipt then that macro accesses the emailcontent

Is there a mechanism that allows developers to set off a VBA macro
upon the receipt of every email?

(Sort of like the out-of-office mechanism but evoking a VBA macro
instead of a new email message.)

Also does someone have an example where this is set up and the VBA
macro
accesses the email content of the message that was received?

I'm using Outlook 2003.

Thanks.
  #2  
Old February 4th 09, 09:11 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Set off VBA macro on email receipt then that macro accesses the email content

You can use the ItemAdd event handler for the Items collection of the Inbox
for that.

Search for "zaphtml" at www.outlookcode.com for an example of an ItemAdd
handler that converts all HTML emails into plain text emails.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


wrote in message
...
Is there a mechanism that allows developers to set off a VBA macro
upon the receipt of every email?

(Sort of like the out-of-office mechanism but evoking a VBA macro
instead of a new email message.)

Also does someone have an example where this is set up and the VBA
macro
accesses the email content of the message that was received?

I'm using Outlook 2003.

Thanks.


  #3  
Old February 4th 09, 11:46 PM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 4
Default Set off VBA macro on email receipt then that macro accesses theemail content

Hi Ken,

The tip you provided lead me on a journey where I ended up installing
Collaboration Data Objects. (Microsoft CDO 1.2.1 Library).

This URL was helpful: http://j-integra.intrinsyc.com/suppo...aspx?id=113792
..

I followed the instructions and forturnately I was able to install
from the network without a CD.

Now....

1. Where is the recommended place to put the code for
Application_Startup() and olInboxItems_ItemAdd() ?

Microsoft Office Outlook Objects -ThisOutlookSession- (General
Module)

Or anyplace, such as:

Modules - Module1

2. When I log out of this account - will the AddItem code turn off?

Thanks.

  #4  
Old February 5th 09, 12:14 AM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Set off VBA macro on email receipt then that macro accesses the email content

The code goes in the ThisOutlookSession class. The code is running
in-process with Outlook, so if Outlook is closed the code stops.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


wrote in message
...
Hi Ken,

The tip you provided lead me on a journey where I ended up installing
Collaboration Data Objects. (Microsoft CDO 1.2.1 Library).

This URL was helpful:
http://j-integra.intrinsyc.com/suppo...aspx?id=113792
.

I followed the instructions and forturnately I was able to install
from the network without a CD.

Now....

1. Where is the recommended place to put the code for
Application_Startup() and olInboxItems_ItemAdd() ?

Microsoft Office Outlook Objects -ThisOutlookSession- (General
Module)

Or anyplace, such as:

Modules - Module1

2. When I log out of this account - will the AddItem code turn off?

Thanks.


 




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
macro to email calendar Lance Hoffmeyer Outlook and VBA 1 May 27th 08 12:50 AM
OL 2003 crashes on macro (Alt-F8) or macro editor (Alt-F11) mikewillnot Outlook - General Queries 0 May 5th 08 03:42 PM
Outlook macro abends but Word macro runs successfully Jreue Outlook and VBA 0 December 13th 06 11:55 PM
Call macro stored in Excel workbook from Outlook's macro Gvaram Outlook and VBA 5 October 4th 06 06:26 AM
email forwarding macro JTL Outlook and VBA 2 February 7th 06 05:42 PM


All times are GMT +1. The time now is 04:54 PM.


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.