Results 1 to 2 of 2
2006-01-17, 13:08 #1
- Join Date
- Oct 2002
- Leamington Spa, Warwickshire, England
- Thanked 0 Times in 0 Posts
Copy Messages to Word (XP 2002/2003)
I have a colleague who would like all the emails transferred to separate word documents by a single click! She would like each email to be copied into word so they are separate files but wants to do it in one big go. If you select several emails, file, save as it will copy and paste the contents into a txt file that can be opened in word, but that is not good enough. Any ideas?
2006-01-17, 16:55 #2
- Join Date
- Dec 2000
- Salt Lake City, Utah, USA
- Thanked 6 Times in 6 Posts
Re: Copy Messages to Word (XP 2002/2003)
<P ID="edit" class=small>(Edited by JohnBF on 17-Jan-06 10:55. Added change "Type:=olMSG" to "Type:=olTXT"). )</P>A simple approach, if your colleague would accept the ability to save each file to a text format, which can be opened by Word, is already in the code posted <!post=here, 285598>here<!/post> (except within the code you will need to change "Type:=olMSG" to "Type:=olTXT"). Note that a text formatted file will not carry over any attachments to the message.
If your colleague insists that the final format be a Word document, it can be done through substantially more extensive VBA code. Maybe there is a better way, but I would approach something like:
Create a hidden instance of the Word application;
Save each selected message to a text file in a temporary directory, adding the message date as part of the file name;
Import each txt message into the Word instance and resave the file as *.doc; either to a default folder, or to a folder that the user has to select for each message.
if your colleague insists that the Word document carry over attachments, that adds further to the complexity; saving to text format won't do. HTML, RTF and *.MSG formats carry the messages, but *.MSG formats are not directly recognized by Word. I think you would have to use the clipboard to copy over the message headers, attachments and message body text in separate steps, and that puts me out of my depth, perhaps a Word VBA expert can help you with that.-John ... I float in liquid gardens