Jump to content
Macro Express Forums

Outlook.items Into Variables


efreedus

Recommended Posts

My macro opens emails in a folder and prints each into a separate Acrobat.pdf with "CE" followed by the date and time of the email in the filename.

e.g. CE 20060819 8-03 PM.pdf

 

I "grab" the time by opening the email, putting the cursor where the Date Sent always appear, copying to the Clipboard, parsing and tweeking the date and time, and printing to an Acrobat PDF file of that name.

 

What I'm looking for is a way to get Outlook objects into some variables to put more info into the named PDF. I want:

SenderName

ReceivedByName

Subject

CreationTime

 

So I thinking either a Macro in Outlook or VBScript (same as a macro?) or VBA code, etc written and "resident" in Outlook to be run as a macro or called by ME.

 

Anyone have such code or point me in the right direction?

Link to comment
Share on other sites

  • 4 weeks later...

I'm writing a similar macro now. Although I have no solution to the additional fields, I'm wrestling with control handles in multiple windows, I would like to suggest you save it as an .MSG file instead. We were going to do PDF as most of our documentation is that way but it doesn’t preserve the attachments like an MSG file. Also a “File Save as” is very simple.

 

Let me know if you come up with some cool script. I was using the controls to grab the date and subject but ME gets confused with multiple windows open and I'm trying to find a work-a-round.

Link to comment
Share on other sites

I was just looking at your list and you can get all of this from the header I think. My macro is using windows controls to grab the From, To, Subject, and Sent text values. It works much better than mouse clicking and requires no user intervention. My only problem is when the user has more than one message open at a time but I think I'll put in a routine that plows thru all the windows titles and ensures only one with the text " - Message (" appears. Otherwise the controls thing isn't reliable.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...