View Single Post
  #1  
Old July 24th 09, 07:46 PM posted to microsoft.public.office.developer.outlook.vba,microsoft.public.outlook.program_vba
Matt Williamson
external usenet poster
 
Posts: 21
Default CDO hanging on Logoff


Most likely you still live MAPI objects used by CDO object at the time
when
you call Logoff.
Does it owkr if you only have calls to Logon and Logoff with nothign in
between?
Try to to all CDO handling code into a separate sub:

Set objCDOSession = CreateObject("MAPI.Session")
objCDOSession.Logon...
DoCDOStuff(objCDOSession)
objCDOSession.Logoff

This way all implecit variables (such as thouse created when yo uuse
multiple dot notation) will be released when the DoCDOStuff sub above
exits.


Thanks for the reply Dmitry

I tested it by calling Logon and then Logoff immediately following it. It
still hangs.

Here is my test

Sub TestCDO()

Dim objCDOSession As Mapi.Session

Set objCDOSession = CreateObject("MAPI.Session")

objCDOSession.Logon "", "", True, False
'objCDOSession.Logon "", "", True, True
objCDOSession.Logoff

Set objCDOSession = Nothing


End Sub

I also disabled all Add-ins and Com Add-ins and while Outlook loads a while
lot faster, it hasn't alleviated the hang. Is there anything else you can
think of?

TIA

Matt



Ads