Custom Header on Outlook Message

G

Gary2Seven

How can I add a custom header to an outlook message?
X-Archive-Reference: 6785

I am using automation to create a message item and then display it to the
user.
They then send, but my programme is the BCC recipient and I want to identify
the email.

If this can not be done, is there any way to get the BillingInformation or
Voting properties into the email header?
 
G

Gary2Seven

Can you tell me where I can locate the correct CDO for XP ? I have cdosys.dll
but this will not register, I think because it's the wrong version? Anyway I
can not create a mapi.session object, I think because of the CDO problem.

Thanks for the help so far.

Gary.
 
S

Sue Mosher [MVP-Outlook]

You need CDO 1.21, which is an optional component in the Outlook
installation. YOu probably need to rerun setup.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Gary2Seven

Sue,

Thanks I have CDO installed and running, I've converted your sample code to
run in Visual Foxpro 9, however I have a slight problem.

What I want to do is create the message, add the header field and then pop
it up in outlook for the user to send.

In Pseudo code:

oOutlook=CreateObject("outlook.application")
oMessage=oOutlook.CreateItem(olMailItem)
oMessage.To="(e-mail address removed)"
oMessage.subject="Test"
lcValue="978676"
AddHeaderX(oMessage,"X-Archive-Reference",@lcValue)

If I use the oItem.Send line within the AddHeaderX (as in the code sample)
the email is sent and the Header field IS there. However if I do not send
from the CDO and do:

oMessage.Visible=.T.

And then send from outlook, The field is not persisted and does not go in
the email.

Any Ideas?


Gary.
 
S

Sue Mosher [MVP-Outlook]

Make sure you save the item, get its EntryID and StoreID, and then
dereference the related MailItem and Message objects. You can then use the
Namespace.GetItemFromID method to return the MailItem and display it.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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