Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / June 2005

Tip: Looking for answers? Try searching our database.

Outlook 2003 SaveAs to msg-file (non-unicode)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Philippe Requilé - 30 May 2005 15:34 GMT
When I save a mailitem with mailitem.SaveAs(filename, olMsg) to a msg  file,
I can't open the msg-file with outlook XP or 2000. Issume this is because it
is saved as unicode.

When I manually save a mailitem in Outlook with 'Save as' and I choose
"Outlook (msg), I can open it in Outlook XP.
And when I manually save a mailitem in Outlook with 'Save as' and I choose
"Outlook - unicode (msg), I can't open it in Outlook XP.

I want to save the msg in non-unicode with the visual basic SaveAs method,
but I don't find which parameters I have to use. Since outlook 2003 , there
is a new olSaveAsType: olMSGUnicode, but then it is in unicode of course.

Who can help?
Eric Legault [MVP - Outlook] - 30 May 2005 21:04 GMT
Strange - if you used olMsg, it *shouldn't* save it in Unicode format.  Even
if you don't specify the Type argument for the SaveAs method, olMsg is the
default.

However, apparently the default format in 2003 is Unicode.  You may need to
turn this off, and then try your code again.  Steps are in this article:

You receive a "Cannot Start Microsoft Outlook" message, and you cannot open
a saved message (.msg) file in Outlook 2003:
http://support.microsoft.com/default.aspx?scid=kb;en-us;824122

Signature

Eric Legault - B.A, MCP, MCSD, Outlook MVP
--
Try Picture Attachments Wizard for Outlook!
http://tinyurl.com/9bby8
--
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

> When I save a mailitem with mailitem.SaveAs(filename, olMsg) to a msg  file,
> I can't open the msg-file with outlook XP or 2000. Issume this is because it
[quoted text clipped - 10 lines]
>
> Who can help?
Philippe Requilé - 31 May 2005 07:43 GMT
Yes this must be a bug. It should be possible to save a msg in the previous
format.
Is it possible to uncheck the checkbox "Use Unicode Message Format when
saving messages " with vb-code with ole automation? Otherwise I have to
uncheck this checkbox on every computer manually.

> Strange - if you used olMsg, it *shouldn't* save it in Unicode format.
> Even
[quoted text clipped - 9 lines]
> a saved message (.msg) file in Outlook 2003:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;824122
Philippe Requilé - 31 May 2005 09:51 GMT
> Is it possible to uncheck the checkbox "Use Unicode Message Format when
> saving messages " with vb-code with ole automation?

If found out how to change the checkbox  automatically.
it is a registry setting:
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\General]
"MSGFormat"=dword:00000000

MSGFormat = 1 -> unicode
MSGFormat = 0 -> non-unicode
Eric Legault [MVP - Outlook] - 31 May 2005 15:12 GMT
You can also control this with Group Policies:

Managing Outlook Settings for Office 2003 SP1:
http://www.windowsitpro.com/Article/ArticleID/45017/45017.html

Signature

Try Picture Attachments Wizard for Outlook!
http://tinyurl.com/9bby8
--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

> > Is it possible to uncheck the checkbox "Use Unicode Message Format when
> > saving messages " with vb-code with ole automation?
[quoted text clipped - 6 lines]
> MSGFormat = 1 -> unicode
> MSGFormat = 0 -> non-unicode
Dmitry Streblechenko - 31 May 2005 18:11 GMT
Of course it is possible:

MailItem.SaveAs(..., olMsg) - saves in the ANSI format
MailItem.SaveAs(..., olMSGUnicode) - saves in the Unicode format
MailItem.SaveAs(...) - saves in the whatever the default MSG format is.

olMsg = 3, olMSGUnicode = 9.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

> Yes this must be a bug. It should be possible to save a msg in the
> previous format.
[quoted text clipped - 16 lines]
>> a saved message (.msg) file in Outlook 2003:
>> http://support.microsoft.com/default.aspx?scid=kb;en-us;824122
Philippe Requilé - 01 Jun 2005 09:05 GMT
> Of course it is possible:
>
> MailItem.SaveAs(..., olMsg) - saves in the ANSI format
> MailItem.SaveAs(..., olMSGUnicode) - saves in the Unicode format
> MailItem.SaveAs(...) - saves in the whatever the default MSG format is.
> olMsg = 3, olMSGUnicode = 9.
That's how it should work, but it doesn't work like that in Delphi7 +
TOutlookApplication (outlook2000.pas) component.
With MailItem.SaveAs(..., olMsg) we get a Unicode format too.
But perhaps it is a problem of the Toutlookapplication component; perhaps it
removes the 2nd parameter when the value =3?
Dmitry Streblechenko - 01 Jun 2005 21:26 GMT
I very much doubt that Delphi wrappers are that smart.
I cannot reproduce this problem. If you have OutlookSpy installed, can you
run the following script in OutlookSpy (select a message, click the Item
button, go to the Script tab, paste the script, click Run). Are the sizes
different?

mailitem.saveas "c:\temp\ansi.msg", 3
mailitem.saveas "c:\temp\unicode.msg", 9

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

>> Of course it is possible:
>>
[quoted text clipped - 7 lines]
> But perhaps it is a problem of the Toutlookapplication component; perhaps
> it removes the 2nd parameter when the value =3?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.