mailitem

MS Outlook VBA - When is a MailItem not a MailItem?

I have written a message handler function in Outlook's Visual Basic (we're using Outlook 2003 and Exchange Server) to help me sort out incoming email. It is working for me, except sometimes the rule fails and Outlook deactivates it. Then I turn the rule back on and manually run it on my Inbox to catch up. The rule spontaneously fails and...

Extract message attachment from Exchange journaling envelope

I'm trying to restore some deleted mail items using Exchange 2007 message journal items as a data source. The journaling is configured such that any incoming/outgoing messages are stored in a journal envelope message as an attachment. Does anyone know of a utility that will take a list of Journal Mail Items (whether in a mailbox or a PS...

Outlook MailItem: How to distinguish whether mail is incoming or outgoing?

Hi, I am writing VSTO Outlook addin in C#, and I need to distinguish, whether given MailItem is incoming or outgoing (or neither, when it is for example a draft). Is there some foolproof way to do this? Best solution I have now would be getting a list of recipients, cc's, and bcc's, loading email adresses from active accounts, and chec...

Outlook MailItem Save/SaveAs

Hi, I have an outlook add-in that allows the user to save an email into a database. When the user does save the email i modify the email subject so it can be identified as being saved. Saving the email can happen in two ways. Via a button on the tool bar which allows the user to save any email they want, and also via a prompt which app...

Toggling digital signing in Outlook.MailItem

In Outlook 2007, I have written an Application_ItemSend handler which needs to turn off digital signing for selected messages, even though signing is normally on by default for all messages. How can I activate/deactivate signing for MailItem objects? ...

Can I iterate through all Outlook emails in a folder including sub-folders?

I have a folder which contains a number of emails and sub-folders. Within those sub-folders are more emails. I'd like to write some VBA which will iterate through all emails in a certain folder, including those in any of the sub-folders. The idea is to extract the SenderEmailAddress and SenderName from every email and do something with ...

Capturing changes to MailItem.SendUsingAccount property in Outlook

I am working on an Outlook extension that requires making a change to a MailItem open in a compose window if the SendUsingAccount property is changed via the GUI. I would like to be albe to apply my changes automatically, but I cannot find any events that are raised when the user makes the change. I have tried listening to the followin...

Unable to find any AttachmentDelete/Removed event on Outlook MailItem

Hi, I am doing some stuff whenever an attachment is added to a being-composed mailItem, on AttachmentAdd event of MailItem, and things work fine. Now I want to undo the same stuff, when an attachment is removed, and I dont see any AttachmentDelete/Removed event or anything similar. Is there a way to get a notification/event when an att...

How to do Global (ie GMT) Outlook MailItem timestamp?

Hi, I need to download emails from a shared Outlook 2003 mailbox and store various properties in an Access database. One of the most important is the timestamp. Of all the properties of the MailItem, there are four timestamps:- . 12 CreationTime 13/04/2010 09:41:26 17 LastModificationTime 13/0...

How long does a MailItem.Property[myProperty] live?

I'm writing a TransportAgent for Exchange and want to tag a MailItem with some identifying information. The MailItem class seems to have this functionality with the MailItem.Properties property; however, my question is to the length of time an entry would remain available. e.g. e.MailItem.Properties.Add(new KeyValuePair<string,object>...

How do I determine if an Exchange mail item is an auto reply message?

I have a .NET application that polls an Exchange email mailbox for new messages on a scheduled basis. Further processing happens when new messages are found in the email mailbox. I've encountered an issue with the processing when auto reply messages are received in the mailbox [e.g. auto reply rule, or Out of Office messages]. I nee...

Reading properties from a Mailitem in Outlook outbox makes it not send

I'm writing a VSTO app for Outlook 2007 that periodically checks mails in the Outbox. I can run over the MailItems and check the .Submitted property with no adverse effects. But if I read the SentOn property than the mail in Outlook stops being italicised and no longer gets sent. I have to go mailitem.Send() to make sure it still gets...

Outlook MailItem opened from standalone file, or not?

I'm developing an Outlook addin in C# and have a problem distinguishing mails opened from a folder (Inbox, Sent etc) from mails opened from a standalone .msg file. I've tried inspecting the Parent property, but it shows Inbox for both kinds. Any ideas out there? /Sam ...