Item Add Event fires intermittently

Not open for further replies.

Surinder Singh

New Member
Outlook version
Email Account
Exchange Server 2007
Hi All
I am after some suggestion on Item_add event in outlook.
In my program before item add event I have initialised it using application startup procedure.
I have installed this script in couple of same config laptops using ( outlook 2007) and have seen in some laptop it does behave intermittently and this event doesn't fire when item arrives in inbox.

my question is

1. is there is specific condition need to be met to run this event every time?
like a) do we need to restart outlook every time before connecting to company server or we connect our server first then open the outlook.

2. does it have anything to do how many email arrives in inbox same time?

3. in the same script DIR() function doesn't work on some laptop and in some it does despite having same settings.

Any feed back/ solution on this highly appreciated?
ItemAdd fires for every item that comes into the folder while Outlook, that is the VBA script, is running. It does not fire if Outlook is connected to Exchange and the item arrives while Outlook is not running.

As to #3: check the values you pass to the Dir function . Depending on what "doesn't work" means, most likely you point to files/directories that doesn't exist or the user hasn't the necessary permissions for.
Thanks Michael
I am not sure how to interpret this.. item arrives while outlook is not running in your reply. could you please elaborate bit more on this.

regarding DIR() function, essentially we all have same rights in their laptops for the file ( excel file) which is sitting on network server. in fact when I did testing I had three laptops side by side and when i executed this function in one (mine) it worked but failed to work on other two.
Exchange can receive emails while your Outlook is not running. In that case when you start Outlook, the item is aready in the folder, thus ItemAdd doesn't fire. In order to handle this situation you must loop through the folder items at the startup of Outlook, identify those 'new' messages, and do whatever ItemAdd is supposed to do.

If you pass, for instance, 'e:\folder\file.txt' to Dir it will fail if the drive has another name, 'k' for instance, on the other computers. For accessing network servers, you should pass 'server name\share name\folder name\...'
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
V How to add 'Previous Item' and 'Next Item' to the Quick Access Toolbar Using Outlook 1
S How to add a new menu item to a right click context menu of a link Using Outlook 5
H Add an item to the "new" - option in outlook toolbar Outlook VBA and Custom Forms 6
T Outlook365 search item listed as "potential matches" can't be opened Using Outlook 0
H Outlook 365 O365 outlook calendar item editing Using Outlook 1
P "Item could not be moved" message occurs frequently for IMAP inbox, Office 365 Using Outlook 0
O In Agenda-view - How to copy an existing item months ahead or back? Using Outlook 0
S Outlook 2016 dont delete inbox item Using Outlook 0
talla Can't open Outlook Item. Using Outlook 0
N Item cannot be saved because it was modified by another user or window, and, Item could not be moved... Using Outlook 0
B Zoom automatically next email item (VBA) Outlook VBA and Custom Forms 2
S Command Button_Click action on Item/Reminder Outlook VBA and Custom Forms 3
A Unflag Inbox and Flag Inbox with Orange Category After Item is send Outlook VBA and Custom Forms 3
A Run-time error '430' on certain emails when trying to set "Outlook.mailitem" as "ActiveExplorer.Selection.Item" Outlook VBA and Custom Forms 2
C Copy Move item won't work Outlook VBA and Custom Forms 2
T Pictures degrade each time an Outlook item is edited and re-saved Using Outlook 1
B Change row background color of selected item Using Outlook 1
P Outlook 2013 "Item could not be moved - still an issue for Outlook 2013 Using Outlook 0
R Error when trying to forward current email item Outlook VBA and Custom Forms 7
geoffnoakes Find Contacts with UDFs "in this item" Using Outlook 1
T "cannot find the calendar folder for this item" - calendar items stuck in outbox Using Outlook 0
GregS Many Sent Item folders Using Outlook 3
B Select / activate first email item in the searched query Using Outlook 1
4 Macro to set the category of Deleted Item? Outlook VBA and Custom Forms 2
N "Discussion" item Using Outlook 3
T opens with "item not found" Using Outlook 1
Peter H Williams How to Move Mail item after processing Outlook VBA and Custom Forms 5
C Change default "Save Sent Item To" folder Outlook VBA and Custom Forms 9
M Shortcut to another outlook item Using Outlook 0
M Item edits doesn't always sync Using Outlook 11
Cdub27 Your changes to this item couldn't be saved because Server Denied Operation (HTTP 403 Forbidden) Using Outlook 1
M VBA to change flag status in outlook contact item Outlook VBA and Custom Forms 3
P Replying to calendar item using VBA Outlook VBA and Custom Forms 4
G Outlook item link Using Outlook 0
Q VBA Script to move item in secondary mailbox Outlook VBA and Custom Forms 2
D Save Sent Item to Using Outlook 0
T outlook 2010 mail item count doesnt match display Outlook VBA and Custom Forms 3
Jeanne Goodman Delete Calendar Item Bypassing Deleted Items folder Outlook VBA and Custom Forms 2
Diane Poremsky Display the Created Date field of any Outlook item Using Outlook 0
Diane Poremsky Outlook VBA: Work with Open Item or Selected Item Using Outlook 0
Z Item.Recipients for Task Assignment on Send Outlook VBA and Custom Forms 10
M How does Outlook determine item numbers in a folder? Outlook VBA and Custom Forms 3
J "This item has been changed still want to delete it" message Using Outlook 3
oliv- HIDE ITEM Outlook VBA and Custom Forms 3
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
T Create new item in public folder using VBscript Outlook VBA and Custom Forms 1
D Shared Mailbox with mail item marked as "private" Using Outlook 0
Diane Poremsky Change Item Count on All Folders in a Data File Using Outlook 0
M Recurring icon for custom form task item Outlook VBA and Custom Forms 6
N Adding Appointment Item in Outlook to Shared Calendar Folder Outlook VBA and Custom Forms 7

Similar threads