.Net and Outlook.Application problem.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 1andy1
    New Member
    • Sep 2008
    • 2

    .Net and Outlook.Application problem.

    Hello,

    I have a following problem.
    Development environment Windows XP, VS 2008, Outlook 2003.
    Deployment environment Small bussiness server, Outlook 2000.
    I have created a small VB .Net program which forwards emails using Outlook application. This program is called from MS-SQL every 2 min.
    At the end of the program I close all the resources, but Outlook.exe process is still displayed in the Task manager.
    Here is the code I use for closing the Outlook.

    OlApp = CreateObject("O utlook.Applicat ion")
    myNS = OlApp.GetNamesp ace("MAPI")
    myNS.Logon()
    ...
    myNS.Logoff()
    OlApp.Quit()
    Marshal.Release ComObject(OlApp )

    GC.Collect()
    GC.WaitForPendi ngFinalizers()
    GC.Collect()

    Since I do not have Microsoft.Offic e.Interop.Outlo ok.dll for Outlook 2000 I use one generated by VS 2008 for Outlook 2003. If this is a problem, than I don't understand why everything (forwarding mails) works OK but closing the Outlook.

    Thanks.
  • jg007
    Contributor
    • Mar 2008
    • 283

    #2
    check this -



    I'm not sure if this is relevant but I have also noticed outlook.exe in task manager when I have quit outlook sometimes and the newmail envelope appears even though outllok is not opened so it may just be a feature/bug :)

    Comment

    Working...