Refresh outlook folders after mailAdd event fires

  • Thread starter Thread starter MooseMan
  • Start date Start date
M

MooseMan

I have developed an add in(plug in) for Outlook 2003 using VSTO and c# .net
2005.
The addin captures all incoming emails and processes them. As they are
processed, I update
ewMail.FlagStatus = Outlook.OlFlagStatus.olFlagComplete which tells me the
email was processed. This is also a good visual for the customer to see that
the add in is working. The flag does not get refreshed on the form unless you
reselect the inbox folder. Is there any way to refress the outlook folder
from an outlook add in?
 
How can I access the main form from the add in? Right now I have a reference
to the folders via the following command
Outlook.MAPIFolder me = mapiNamespace.GetDefaultFolder(
Outlook.OlDefaultFolders.olFolderOutbox ) as Outlook.MAPIFolder;

Any help would be greatly appreciated, Ken.
 
What main form?

Your reference is to the Outbox, however you shouldn't be messing with items
in the Outbox..

Let's say you have 2 folder references: folder A and folder B, A is the
current folder and Outlook.Application is oApp.

Outlook.Explorer exp = oApp.ActiveExplorer(); //get ActiveExplorer
exp.CurrentFolder = B;
exp.CurrentFolder = A;

That moves the focus from A to B and back again.
 
Ken, tks for the input.
By 'main form; I meant the current folder.
I am processing events from the inbox folder.
To solve the problem I performed the following code:

Outlook.Application oApp;
oApp= mapiNamespace.Application;
Outlook.Explorer exp = oApp.ActiveExplorer(); //get
ActiveExplorer

exp.CurrentFolder = Holdme;
exp.CurrentFolder = inbox;

of course mapiNamespace,Holdme(pointer to SendItems), and inbox were
instantiated when the dll was loaded within default constructor.

Thanks Ken for all your valued help!
 
Back
Top