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 » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

New mail event doesn't work all time



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old February 1st 07, 11:49 AM posted to microsoft.public.outlook.program_addins
DavidE
external usenet poster
 
Posts: 8
Default New mail event doesn't work all time

Hi,

I created a com add-in that fires an event when a new mail arrives. This is
the code:
Private WithEvents objNS As Outlook.NameSpace
Private WithEvents colItems As Outlook.Items

Private Sub Application_Startup()
Set objNS = Application.GetNamespace("MAPI") 'NameSpace Object
Set colItems = objNS.GetDefaultFolder(olFolderInbox).Items
....
End Sub

Private Sub colItems_ItemAdd(ByVal Item As Object)
Code to handle incoming mail
End Sub

Usually, this code does the work but some times it doesn't. When it stop
working the event doesn't fire for all incoming mails. I fix it by closing
and reopen the outlook. When the outlook is reopen it loads the add-in.Some
times I need to restart the computer. I tried to solve this problem by
cretaing a schedule task for a bat file that contain a regsvr32 command for
this dll but it doesn't solve the problem. I don't think that it's a problem
of code but I think that it's a problem of the outlook that unload the add-in
without a logical reason.

I'll glad to get help for this problem.

Thanks,

David
 




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
locking the time zone for an event Jetlagged&shoeless Outlook - Calandaring 1 October 6th 06 12:03 AM
Work part time and need my free/busy time to reflect that in Outl. allensxs3 Outlook - Calandaring 1 July 13th 06 02:14 PM
work week calendar I want to see only my strat time to end time? Audrey Racine Outlook - Calandaring 1 May 11th 06 04:55 PM
How do I remove a time from an all day event? Gran2ty Outlook - Calandaring 1 May 10th 06 05:08 PM
How to enter work start time PM end time AM wmllmw Outlook - Calandaring 5 April 15th 06 06:23 PM


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