Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving emails basic nifo

Status
Not open for further replies.

Jtorres13

Technical User
Nov 11, 2006
162
US
I'm a VBA newbie and I need to create a "magic button" in Outlook that will take all emails found in one folder and save them individually to a folder in C:\emails as RTF files. It has to also save attachments, if any are found.

Since I'mnew, I'm kid of lsot on where I need to begin. Can someone show me the basic structure, objects, classes to use, maybe a sample program. Here's what I think I need to do:

1. Open the application
2. Create a mail session
3. Open the MAPI folder (so I can then access the emails)
4. Access the folder and select all items
5. count all the items in the folder so I know when to stop
6. Save all items one at a time using a For/Next until I reach the total number found on step 5.
 
Thank you for the post. I couldn't find anything on the forum. The link is very useful and I got working right away.

HOWEVER, I didn't listen to requirements or asked much questions. I assumed that when she said "I ave a CD full of emails" she meant a .PST. But the CD is full of individual .msg files!

Now I have to start from scratch. I don't need to open a mail fodler, I need to open nidividual files and convert them to RTF, save them in a different folder, etc....

:(

Any ideas on how to open a .msg file in Outlook? I think I can figure out the rest by rehashing my code.

 
Check out the "/f" switch in Outlook. It should solve your problem. In Outlook open Help, type msg, and then open "Command-line switches" for basic instructions.
 
I tried this but it didn't help. We are going to buy a third party tool that can do this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top