Get Foldername upon MAPIFolder.Items.ItemAdd event

M

morna

I have an outlook add-in that deals with the ItemAdd event for a
MAPIFolder. When the ItemAdd event fires, I have access to the
MailItem or Item added to the folder. Is there a way to find out
which folder fired the event? I don't think there is a way to find
this information on the MailItem, but any thoughts? I have tried to
catch the ItemRemove and ItemAdd for a given folder, but the
ItemRemove does not fire consistently. I have added the Items object
from the MAPIFolder as a class inside the Connect.cs class, but have
found articles on Microsoft that the events may not consistently
fire. The ItemAdd event for the folder does fire consistently.

Any thoughts would sure help out. Thanks for your time
 
M

morna

I do store the Folder name when I register for the ItemAdd event.
What I really need is to know which folder fires the ItemAdd event. I
have several folders that are being registered for the ItemAdd event
and I am running the same function for each folder's ItemAdd event,
however, I need to know which function fired the ItemAdd event since I
do not receive an "object Sender" on the event - is there a way to ask
the Outlook.Application object or something? I allow the user to
passing the folder names - therefore it is dyanmic - the number and
name of the folders.

Thanks for your time.

-Morna
 
M

Michael Bauer [MVP - Outlook]

Hm, I don't understand what you're doing. Are you saying that you have one
event procedure that's called from different folders? I wouldn't know how to
achieve that - but more important: why do you do that?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Quick-Cats - Categorize Outlook data:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am 18 Apr 2007 06:51:37 -0700 schrieb morna:
 
S

Sue Mosher [MVP-Outlook]

Couldn't you get the folder as the added item's Parent?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


Am 18 Apr 2007 06:51:37 -0700 schrieb morna:
 
M

morna

Michael -

I have a client that has several hundred projects; for each project
they have a corresponding SharePoint website that contains a document
library. Each project also has a team of individuals that correspond
via email (Outlook) upon project tasks. Today the team members save
emails (*.msg) files to their harddrives then opens up the SharePoint
document library and uploads the saved *.msg files so other team
members can view the email correspondance within the Shared Document
library. (The client is using Outlook 2003 and SharePoint 2003 - with
no plans of moving to Outlook or SharePoint 2007 anytime soon). They
wanted to allow each Outlook use to have a Outlook folder for these
email. My Outlook AddIn reads a configuration xml file (upon a
website so that an administrator can easily change the projects).
This XML file contains the project Outlook folder name and the
matching SharePoint website URL/SharePoint document library url. Each
Outlook user manually creates their Outlook folders for the project
they are working on. If the Outlook folder is present, the Outlook
Addin will catch each item moved into the folder, copy it, and
automatically upload the newly added email to the correct SharePoint
document library. The client does not want to have a limit on the
number of projects/Outlook folders that can be configured. I can
allow then to configure as many sets of information they want (Outlook
folder name paired with SharePoint document library URL), but if I
can't get the folder name from the MailItem upon the ItemAdd event
firing - I have to define the number of folders I can support.

Hope you understand :) thank you for your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top