A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Save Email message as HTML file on Harddrive



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 5th 08, 04:28 PM posted to microsoft.public.outlook.program_vba
TerryM
external usenet poster
 
Posts: 8
Default Save Email message as HTML file on Harddrive

I've seen quite a few questions asking this on the web, however I have not
seen an answer to it.

I am trying to create an outlook rule that will run on these criterias,
By sender--Easily done in the Outlook rule
By Subject--Easily done in the Outlook rule
run as script--Saves email message as either text or Html to a harddrive.
From there I will do an import into either excel or access to get the
information i need.

So basically what I am trying to find is the script to save the email
message (no attachments) to a hard drive.
  #2  
Old November 6th 08, 09:12 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Save Email message as HTML file on Harddrive



Simply call the item's Save method. There should be an example in the VBA
help file.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 5 Nov 2008 08:28:00 -0800 schrieb TerryM:

I've seen quite a few questions asking this on the web, however I have not
seen an answer to it.

I am trying to create an outlook rule that will run on these criterias,
By sender--Easily done in the Outlook rule
By Subject--Easily done in the Outlook rule
run as script--Saves email message as either text or Html to a harddrive.
From there I will do an import into either excel or access to get the
information i need.

So basically what I am trying to find is the script to save the email
message (no attachments) to a hard drive.

  #3  
Old November 10th 08, 01:44 PM posted to microsoft.public.outlook.program_vba
TerryM
external usenet poster
 
Posts: 8
Default Save Email message as HTML file on Harddrive

I tried the items save as method. It didn't seem to work, that or I had the
code wrong. Mind you I'm pretty new to coding. I've don't a little in Excel
and Access however Outlook is a whole other beast.

What should the code look like anyway. Mind you I'm wanting this to run in
a Rule, so when the email comes in it automatically saves the message body as
an html file to the network drive.

"Michael Bauer [MVP - Outlook]" wrote:



Simply call the item's Save method. There should be an example in the VBA
help file.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 5 Nov 2008 08:28:00 -0800 schrieb TerryM:

I've seen quite a few questions asking this on the web, however I have not
seen an answer to it.

I am trying to create an outlook rule that will run on these criterias,
By sender--Easily done in the Outlook rule
By Subject--Easily done in the Outlook rule
run as script--Saves email message as either text or Html to a harddrive.
From there I will do an import into either excel or access to get the
information i need.

So basically what I am trying to find is the script to save the email
message (no attachments) to a hard drive.


  #4  
Old November 11th 08, 02:38 PM posted to microsoft.public.outlook.program_vba
TerryM
external usenet poster
 
Posts: 8
Default Save Email message as HTML file on Harddrive

Ok, I figured out what I was doing wrong in regards to the SaveAs Method.
The syntax is different than in Access and Excel. I have been able to save a
file with with a predetermined name to the harddrive. The Message body is
blank however, what code am I missing to select and save the message body
also?

Here is the code listed below:

Sub saveemail(myItem As Outlook.MailItem)
Dim m As MailItem
Set m = CreateItem(olMailItem)
m.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

"Michael Bauer [MVP - Outlook]" wrote:



Simply call the item's Save method. There should be an example in the VBA
help file.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 5 Nov 2008 08:28:00 -0800 schrieb TerryM:

I've seen quite a few questions asking this on the web, however I have not
seen an answer to it.

I am trying to create an outlook rule that will run on these criterias,
By sender--Easily done in the Outlook rule
By Subject--Easily done in the Outlook rule
run as script--Saves email message as either text or Html to a harddrive.
From there I will do an import into either excel or access to get the
information i need.

So basically what I am trying to find is the script to save the email
message (no attachments) to a hard drive.


  #5  
Old November 11th 08, 09:23 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Save Email message as HTML file on Harddrive



In your code, m is a new MailItem, which is blank. If you want to save the
e-mail passed by the rule, use myItem:

Sub saveemail(myItem As Outlook.MailItem)
myitem.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en

Am Tue, 11 Nov 2008 06:38:13 -0800 schrieb TerryM:

Ok, I figured out what I was doing wrong in regards to the SaveAs Method.
The syntax is different than in Access and Excel. I have been able to

save a
file with with a predetermined name to the harddrive. The Message body is
blank however, what code am I missing to select and save the message body
also?

Here is the code listed below:

Sub saveemail(myItem As Outlook.MailItem)
Dim m As MailItem
Set m = CreateItem(olMailItem)
m.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

"Michael Bauer [MVP - Outlook]" wrote:



Simply call the item's Save method. There should be an example in the VBA
help file.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 5 Nov 2008 08:28:00 -0800 schrieb TerryM:

I've seen quite a few questions asking this on the web, however I have

not
seen an answer to it.

I am trying to create an outlook rule that will run on these criterias,
By sender--Easily done in the Outlook rule
By Subject--Easily done in the Outlook rule
run as script--Saves email message as either text or Html to a

harddrive.
From there I will do an import into either excel or access to get the
information i need.

So basically what I am trying to find is the script to save the email
message (no attachments) to a hard drive.


  #6  
Old November 12th 08, 03:22 AM posted to microsoft.public.outlook.program_vba
TerryM
external usenet poster
 
Posts: 8
Default Save Email message as HTML file on Harddrive

That definately took care of the problem. I've noticed that the syntax for
outlook vba is quite a bit different than say Access or Excel. What
resources or books would you suggest for a beginner like me to learn from.

Thanks for all your help.

"Michael Bauer [MVP - Outlook]" wrote:



In your code, m is a new MailItem, which is blank. If you want to save the
e-mail passed by the rule, use myItem:

Sub saveemail(myItem As Outlook.MailItem)
myitem.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en

Am Tue, 11 Nov 2008 06:38:13 -0800 schrieb TerryM:

Ok, I figured out what I was doing wrong in regards to the SaveAs Method.
The syntax is different than in Access and Excel. I have been able to

save a
file with with a predetermined name to the harddrive. The Message body is
blank however, what code am I missing to select and save the message body
also?

Here is the code listed below:

Sub saveemail(myItem As Outlook.MailItem)
Dim m As MailItem
Set m = CreateItem(olMailItem)
m.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

"Michael Bauer [MVP - Outlook]" wrote:



Simply call the item's Save method. There should be an example in the VBA
help file.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 5 Nov 2008 08:28:00 -0800 schrieb TerryM:

I've seen quite a few questions asking this on the web, however I have

not
seen an answer to it.

I am trying to create an outlook rule that will run on these criterias,
By sender--Easily done in the Outlook rule
By Subject--Easily done in the Outlook rule
run as script--Saves email message as either text or Html to a

harddrive.
From there I will do an import into either excel or access to get the
information i need.

So basically what I am trying to find is the script to save the email
message (no attachments) to a hard drive.


  #7  
Old November 14th 08, 12:00 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Save Email message as HTML file on Harddrive



Absolute Beginner´s Guide to Microsoft Office Outlook 2003, by Ken Slovak
Microsoft Outlook Programming, by Sue Mosher
Application Development with Outlook 2002, by Randy Byrne


--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 11 Nov 2008 19:22:00 -0800 schrieb TerryM:

That definately took care of the problem. I've noticed that the syntax

for
outlook vba is quite a bit different than say Access or Excel. What
resources or books would you suggest for a beginner like me to learn from.

Thanks for all your help.

"Michael Bauer [MVP - Outlook]" wrote:



In your code, m is a new MailItem, which is blank. If you want to save

the
e-mail passed by the rule, use myItem:

Sub saveemail(myItem As Outlook.MailItem)
myitem.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en

Am Tue, 11 Nov 2008 06:38:13 -0800 schrieb TerryM:

Ok, I figured out what I was doing wrong in regards to the SaveAs

Method.
The syntax is different than in Access and Excel. I have been able to

save a
file with with a predetermined name to the harddrive. The Message body

is
blank however, what code am I missing to select and save the message

body
also?

Here is the code listed below:

Sub saveemail(myItem As Outlook.MailItem)
Dim m As MailItem
Set m = CreateItem(olMailItem)
m.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

"Michael Bauer [MVP - Outlook]" wrote:



Simply call the item's Save method. There should be an example in the

VBA
help file.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 5 Nov 2008 08:28:00 -0800 schrieb TerryM:

I've seen quite a few questions asking this on the web, however I have

not
seen an answer to it.

I am trying to create an outlook rule that will run on these

criterias,
By sender--Easily done in the Outlook rule
By Subject--Easily done in the Outlook rule
run as script--Saves email message as either text or Html to a

harddrive.
From there I will do an import into either excel or access to get the
information i need.

So basically what I am trying to find is the script to save the email
message (no attachments) to a hard drive.


  #8  
Old November 17th 08, 06:05 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Save Email message as HTML file on Harddrive



Terry, recommended books a

Professional Programming Outlook 2007, Wrox Press, by Ken Slovak
Microsoft Outlook Programming, by Sue Mosher

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 11 Nov 2008 19:22:00 -0800 schrieb TerryM:

That definately took care of the problem. I've noticed that the syntax

for
outlook vba is quite a bit different than say Access or Excel. What
resources or books would you suggest for a beginner like me to learn from.

Thanks for all your help.

"Michael Bauer [MVP - Outlook]" wrote:



In your code, m is a new MailItem, which is blank. If you want to save

the
e-mail passed by the rule, use myItem:

Sub saveemail(myItem As Outlook.MailItem)
myitem.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en

Am Tue, 11 Nov 2008 06:38:13 -0800 schrieb TerryM:

Ok, I figured out what I was doing wrong in regards to the SaveAs

Method.
The syntax is different than in Access and Excel. I have been able to

save a
file with with a predetermined name to the harddrive. The Message body

is
blank however, what code am I missing to select and save the message

body
also?

Here is the code listed below:

Sub saveemail(myItem As Outlook.MailItem)
Dim m As MailItem
Set m = CreateItem(olMailItem)
m.SaveAs "c:\temp\New Power Indices.html", olhtml
End Sub

"Michael Bauer [MVP - Outlook]" wrote:



Simply call the item's Save method. There should be an example in the

VBA
help file.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 5 Nov 2008 08:28:00 -0800 schrieb TerryM:

I've seen quite a few questions asking this on the web, however I have

not
seen an answer to it.

I am trying to create an outlook rule that will run on these

criterias,
By sender--Easily done in the Outlook rule
By Subject--Easily done in the Outlook rule
run as script--Saves email message as either text or Html to a

harddrive.
From there I will do an import into either excel or access to get the
information i need.

So basically what I am trying to find is the script to save the email
message (no attachments) to a hard drive.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I save my inbox/sent messages on my external harddrive? Charles W Davis Outlook - General Queries 0 March 6th 08 03:36 AM
How do I save my inbox/sent messages on my external harddrive? Evgeny Grischenko Outlook - General Queries 1 March 4th 08 05:27 PM
How do I save my inbox/sent messages on my external harddrive? DL Outlook - General Queries 0 March 4th 08 09:19 AM
How do I save my inbox/sent messages on my external harddrive? Gordon[_3_] Outlook - General Queries 0 March 4th 08 08:02 AM
save Email as HTML file with embedded pictures after udpdate HTMLbody Oliv' Outlook and VBA 8 February 5th 07 10:33 AM


All times are GMT +1. The time now is 11:11 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.