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

P

Philippe Requilé

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?
 
E

Eric Legault [MVP - Outlook]

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
 
P

Philippe Requilé

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.
 
P

Philippe Requilé

Philippe Requilé said:
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
 
E

Eric Legault [MVP - Outlook]

You can also control this with Group Policies:

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

--
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/


Philippe Requilé said:
Philippe Requilé said:
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
 
D

Dmitry Streblechenko

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
 
P

Philippe Requilé

Dmitry Streblechenko said:
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?
 
D

Dmitry Streblechenko

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top