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 - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Outlook automation SaveAs method hangs



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 29th 08, 01:58 PM posted to microsoft.public.outlook.interop,microsoft.public.outlook.general,microsoft.public.outlook.program_forms
Yashgt
external usenet poster
 
Posts: 1
Default Outlook automation SaveAs method hangs

Hi,

We are trying to programmtically build a MailItem object in a .NET
program and trying to save it as a .msg file. The code works up to the
point of the SaveAs call, where it hangs indefinitely. What could be
the issue? Please see the code below. We have ensured that no other
instance of Outlook.exe is running when we run our program.

Outlook.Application OutlookApplication = new Outlook.Application();
Outlook.NameSpace olNamespace =
OutlookApplication.GetNamespace("MAPI");
olNamespace.Logon(null, null, false, false);

Outlook.MailItem newMail =
(Outlook.MailItem)OutlookApplication.CreateItem(Ou tlook.OlItemType.olMailItem);
newMail.To = ";
newMail.Subject = objEmailQueueLog.EmailTemplateSubject;
newMail.Body = objEmailQueueLog.EmailTemplateBody;
", Outlook.OlSaveAsType.olMSG);
newMail = null;
olNamespace.Logoff();
olNamespace = null;

Thanks,
Yash
 




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
Outlook Automation Automation Problem Out of Memory MikeA[_2_] Outlook and VBA 7 July 30th 07 02:31 PM
MailItem.SaveAs method Mrunali Outlook - Using Forms 0 April 17th 07 03:16 PM
Redemption's SafeMailItem.SaveAs method yields empty files Alexander Bub Outlook and VBA 4 August 9th 06 11:29 AM
Outlook freezes on Redemption SaveAs [email protected] Add-ins for Outlook 5 April 27th 06 11:46 PM
Outlook freezes on Redemption SaveAs [email protected] Add-ins for Outlook 0 April 27th 06 04:30 PM


All times are GMT +1. The time now is 11:35 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-2025 Outlook Banter.
The comments are property of their posters.