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

outlook 2007 itemadd event handler fails to run



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 6th 09, 04:16 PM posted to microsoft.public.outlook.program_vba
reggiep
external usenet poster
 
Posts: 2
Default outlook 2007 itemadd event handler fails to run

Hi,
I have an event handler called by:

Private Sub Application_Startup()
Set ns = ThisOutlookSession.Session
Set inboxItems = ns.GetDefaultFolder(olFolderInbox).Items
Set myExplorer = Application.ActiveExplorer
MsgBox "Event handler running"
' my warning
End Sub

the event handler processes the item and saves it as a .txt file in a
directory decided by the message contents:

Private Sub inboxItems_ItemAdd(ByVal Item As Object)
......
End Sub

I have two questions (please).

The event handler occasionally stops working. The only was to get it to work
again is by rebooting the PC. If I just close Outlook and restart it, I
sometimes get the "Event handler running" message, but it never works.

Also I read that too many messages being received can stop the event
handler. Is there a known number - or even an approximation?

I can supply the event handler code, but as it works normally I didn't think
it relevant.

Thank you in advance,

Richard
(pretty much a novice)
Ads
  #2  
Old October 6th 09, 06:56 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default outlook 2007 itemadd event handler fails to run



The ItemAdd doesn't fire if more than 16 messages come in. And it doesn't
fire if your Exchange server receives messages while Oulook is closed; if
you later start Outlook, you won't get the ItemAdd event.

Why do you think your code doesn't work? Adding an error handler often helps
to figure problems.

--
Best regards
Michael Bauer - MVP Outlook

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


Am Tue, 6 Oct 2009 08:16:01 -0700 schrieb reggiep:

Hi,
I have an event handler called by:

Private Sub Application_Startup()
Set ns = ThisOutlookSession.Session
Set inboxItems = ns.GetDefaultFolder(olFolderInbox).Items
Set myExplorer = Application.ActiveExplorer
MsgBox "Event handler running"
' my warning
End Sub

the event handler processes the item and saves it as a .txt file in a
directory decided by the message contents:

Private Sub inboxItems_ItemAdd(ByVal Item As Object)
.....
End Sub

I have two questions (please).

The event handler occasionally stops working. The only was to get it to

work
again is by rebooting the PC. If I just close Outlook and restart it, I
sometimes get the "Event handler running" message, but it never works.

Also I read that too many messages being received can stop the event
handler. Is there a known number - or even an approximation?

I can supply the event handler code, but as it works normally I didn't

think
it relevant.

Thank you in advance,

Richard
(pretty much a novice)

  #3  
Old October 7th 09, 09:27 AM posted to microsoft.public.outlook.program_vba
reggiep
external usenet poster
 
Posts: 2
Default outlook 2007 itemadd event handler fails to run

Michael,

Thanks for the info on the 16 max messages.

On the failure to fire, I didn't try an error handler as I tried putting a
message into the eventhandler, right at the beginning and when the problem
manifested, it never displayed, so I guessed that it was the call to the
event handler wasn't being made.

As to what I think is causing it - I have no idea. I will put in an
errorhandler anyway. I will also change the power options so that the system
does not sleep.

Thanks again for your help,

"Michael Bauer [MVP - Outlook]" wrote:



The ItemAdd doesn't fire if more than 16 messages come in. And it doesn't
fire if your Exchange server receives messages while Oulook is closed; if
you later start Outlook, you won't get the ItemAdd event.

Why do you think your code doesn't work? Adding an error handler often helps
to figure problems.

--
Best regards
Michael Bauer - MVP Outlook

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


Am Tue, 6 Oct 2009 08:16:01 -0700 schrieb reggiep:

Hi,
I have an event handler called by:

Private Sub Application_Startup()
Set ns = ThisOutlookSession.Session
Set inboxItems = ns.GetDefaultFolder(olFolderInbox).Items
Set myExplorer = Application.ActiveExplorer
MsgBox "Event handler running"
' my warning
End Sub

the event handler processes the item and saves it as a .txt file in a
directory decided by the message contents:

Private Sub inboxItems_ItemAdd(ByVal Item As Object)
.....
End Sub

I have two questions (please).

The event handler occasionally stops working. The only was to get it to

work
again is by rebooting the PC. If I just close Outlook and restart it, I
sometimes get the "Event handler running" message, but it never works.

Also I read that too many messages being received can stop the event
handler. Is there a known number - or even an approximation?

I can supply the event handler code, but as it works normally I didn't

think
it relevant.

Thank you in advance,

Richard
(pretty much a novice)


 




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
Event loop when saving Task item in event handler Mustafa Add-ins for Outlook 1 August 8th 08 06:24 PM
ItemAdd event fires more than once when adding a new appointment Johan Machielse[_2_] Add-ins for Outlook 1 July 22nd 08 12:11 PM
(VSTO SE) folder.Items.ItemAdd Event does not fire David Outlook and VBA 5 March 7th 07 08:41 PM
Create Outlook Appointment from an Access event handler Capt Jim Cook Outlook - Using Forms 1 August 12th 06 02:38 PM
ItemAdd event with Outlook2007 DavidH&P Outlook - Using Forms 2 July 4th 06 08:29 AM


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