How to obtain full email message headers in VBA

  • Thread starter Steven Marzuola (remove wax and invalid for reply)
  • Start date
S

Steven Marzuola (remove wax and invalid for reply)

(Using Outlook 2000)

I use a VBA routine for Outlook that writes a summary of each mail item
in the current folder to a text file. It works okay, here are a few of
the lines that make it go:

Dim thisFolder As MAPIFolder
Dim Item As Object
...
Set thisFolder = Application.ActiveExplorer.CurrentFolder
For Each Item In thisFolder.Items
...
Print #2, "From:", Item.SenderName
Print #2, "To:", Item.To
Print #2, "Cc:", Item.CC
Print #2, "Sent:", Item.SentOn
Print #2, "Subject:", Item.Subject
...

Now I want to do something different. I'm trying to analyze a folder
full of spam emails, and extract the Received lines (to see where each
one comes from). These can be viewed in Outlook only by viewing the
"Internet Headers". However, I cannot find a Property or Method for my
"Item", that will get me access to the Received lines, or any other
information in the full headers.

Any ideas?
 
S

Steven Marzuola (remove wax and invalid for reply)

After I posted this, I realized, it sounded familiar ... I have asked
about it before. In fact, I found one of my questions on Google. I
just didn't remember getting any answers I liked. There's a possible
solution using CDO.

Unfortunately, this seems to require a detour into learning VBScript,
and/or digging up the original Office disks which *might* have something
on them. Either way, it looks like it will take a lot more time and
effort than I am willing to spend on it. But I'm passing along one
link, in case anyone else might be interested.

http://www.cdolive.com

Steven
 
M

Michael Bauer

Am Tue, 29 Nov 2005 20:57:25 -0600 schrieb Steven Marzuola (remove wax and
invalid for reply):

Steven, you need to use CDO (optional component on your Office CD) or
Redemption (www.dimastr.com). Then read the field
CdoPR_TRANSPORT_MESSAGE_HEADERS
 

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