Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Saveas method (http://www.outlookbanter.com/outlook-vba/80231-saveas-method.html)

ADuPlayee October 14th 08 05:31 PM

Saveas method
 
I am trying to save messages as html files. When using .SaveAs with the
olHTML as the save as type I get 'invalid procedure call or argument' but the
it works fine with other types.

Dmitry Streblechenko October 14th 08 05:44 PM

Saveas method
 
Is that an RTF message? Can you save the same message through teh Outlook UI
(File | Save As)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
I am trying to save messages as html files. When using .SaveAs with the
olHTML as the save as type I get 'invalid procedure call or argument' but
the
it works fine with other types.




ADuPlayee October 14th 08 05:54 PM

Saveas method
 
Yes and everything works fine.

"Dmitry Streblechenko" wrote:

Is that an RTF message? Can you save the same message through teh Outlook UI
(File | Save As)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
I am trying to save messages as html files. When using .SaveAs with the
olHTML as the save as type I get 'invalid procedure call or argument' but
the
it works fine with other types.





Dmitry Streblechenko October 14th 08 07:26 PM

Saveas method
 
What programming language are you using?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
Yes and everything works fine.

"Dmitry Streblechenko" wrote:

Is that an RTF message? Can you save the same message through teh Outlook
UI
(File | Save As)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
I am trying to save messages as html files. When using .SaveAs with the
olHTML as the save as type I get 'invalid procedure call or argument'
but
the
it works fine with other types.







ADuPlayee October 14th 08 07:35 PM

Saveas method
 
VBScript

"Dmitry Streblechenko" wrote:

What programming language are you using?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
Yes and everything works fine.

"Dmitry Streblechenko" wrote:

Is that an RTF message? Can you save the same message through teh Outlook
UI
(File | Save As)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
I am trying to save messages as html files. When using .SaveAs with the
olHTML as the save as type I get 'invalid procedure call or argument'
but
the
it works fine with other types.







Dmitry Streblechenko October 14th 08 11:45 PM

Saveas method
 
What are the relevant snippets of your code?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
VBScript

"Dmitry Streblechenko" wrote:

What programming language are you using?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
Yes and everything works fine.

"Dmitry Streblechenko" wrote:

Is that an RTF message? Can you save the same message through teh
Outlook
UI
(File | Save As)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
I am trying to save messages as html files. When using .SaveAs with
the
olHTML as the save as type I get 'invalid procedure call or
argument'
but
the
it works fine with other types.









ADuPlayee October 15th 08 04:19 PM

Saveas method
 
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.Folders.Item("Mailbox")
Set objCheckFolder = objFolder.Folders.Item('Check")
Set objDOPFolder = objCheckFolder.Folders.Item("O")

Set Message = objDOPFolder.Items(1)

if Message.Subject = "TEST" then
if Message.UnRead then
strName = "C:\Desktop\EMAIL\" & Message.Subject & ".html"
Message.SaveAs strName , olMSGHTML
Message.UnRead = false

end if
end if
"Dmitry Streblechenko" wrote:

What are the relevant snippets of your code?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
VBScript

"Dmitry Streblechenko" wrote:

What programming language are you using?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
Yes and everything works fine.

"Dmitry Streblechenko" wrote:

Is that an RTF message? Can you save the same message through teh
Outlook
UI
(File | Save As)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
I am trying to save messages as html files. When using .SaveAs with
the
olHTML as the save as type I get 'invalid procedure call or
argument'
but
the
it works fine with other types.










Dmitry Streblechenko October 15th 08 06:23 PM

Saveas method
 
What is olMSGHTML?
You are accessing the very first item in the folder; keep in mind the very
first item in the MAPIFolder.Items collection will not necessarily be shown
first (or last) in the Outlook UI.
Look at the Subject property to make sure you are dealing with the expected
message. I bet you have an old RTF message that Outlook refuses to save in
the HTML format.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objFolder = objNamespace.Folders.Item("Mailbox")
Set objCheckFolder = objFolder.Folders.Item('Check")
Set objDOPFolder = objCheckFolder.Folders.Item("O")

Set Message = objDOPFolder.Items(1)

if Message.Subject = "TEST" then
if Message.UnRead then
strName = "C:\Desktop\EMAIL\" & Message.Subject & ".html"
Message.SaveAs strName , olMSGHTML
Message.UnRead = false

end if
end if
"Dmitry Streblechenko" wrote:

What are the relevant snippets of your code?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
VBScript

"Dmitry Streblechenko" wrote:

What programming language are you using?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
Yes and everything works fine.

"Dmitry Streblechenko" wrote:

Is that an RTF message? Can you save the same message through teh
Outlook
UI
(File | Save As)?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"ADuPlayee" wrote in message
...
I am trying to save messages as html files. When using .SaveAs
with
the
olHTML as the save as type I get 'invalid procedure call or
argument'
but
the
it works fine with other types.













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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com