• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2297
  • Last Modified:

Add custom header to Outlook Message in VBA

How do you add custom headers to a message in Outlook using VBA?
0
rbichon
Asked:
rbichon
  • 2
1 Solution
 
Serena HsiMarketing ConsultantCommented:
This site has a COM add-in sample for Outlook header info. Don't forget to backup your registry before you go poking around with it with someone else's code:
http://www.outlook-tips.net/howto/viewing_headers.htm

You can find other code samples here:
http://www.outlookcode.com/article.aspx?ID=40
http://blogs.technet.com/kclemson/archive/2006/10/27/quickly-view-the-internet-headers-of-a-message-in-outlook.aspx

Related items:
http://www.dimastr.com/redemption/
0
 
rbichonAuthor Commented:
I found out that if you mark the message as private, it sets a header called Sensitivity which I can use for my purposes.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Item.Sensitivity = olPrivate
    Cancel = False
End Sub
0
 
macaroneCommented:
rbichon,
that's very interesting.

Can you send me an example in VB.NET that sends a message with some "custom information" using the <sensivity> header?
Also, it would be needed the code to "read" the message's <sensivity> header once is received on the other end.
I hope this is the solution that works!

Thank you,
0
 
rbichonAuthor Commented:
We use Microsoft Exchange Server 2007 to handle our email. In that server program, you can setup rules that are able to read the headers of the emails and perform an action based on what it finds.
In my specific application, we have the Exchange server copy all of our outgoing emails to a central email address so the owner can read what people are sending to the companies clients. However, if our users want to keep the email confidential, all they have to do is mark the email Private and it will bypass the filter.
In short, I don't use VB.Net in this application as Outlook tries to block programs that attempt to gain control over it.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now