JackPollack
Senior Member
- Outlook version
- Email Account
- Exchange Server
I've got a VB app that imports data into Outlook. The import goes much faster when OL is offline.
If OL is not running my code works perfectly, however if OL is currently running after my code execution OL can be closed by the user, but it only closes the OL window. The process continues to run in the background and has to be terminated via Task Manager.
I have narrowed the problem down to this line:
Set objCBCtl = myNS.folders.GetFirst.GetExplorer.CommandBars.FindControl(, 5613)
After that line executes OL wont completely close anymore.
Set mySession = CreateObject ("",Outlook.application)
' Also tried GetObject(, "Outlook.Application")
Set myNS = mySession.GetNamespace("MAPI")
Set objCBCtl = myNS.folders.GetFirst.GetExplorer.CommandBars.FindControl(, 5613)
'objCBCtl.execute ' Take Outlook offline
:
:
:
'objCBCtl.execute ' Take Outlook online
Set objCBCtl = Nothing
Set MyFolder = Nothing
Set myNS = Nothing
Set mySession = Nothing
Having the same problem on WinXP and Win7 OL2003 & OL 2010
If OL is not running my code works perfectly, however if OL is currently running after my code execution OL can be closed by the user, but it only closes the OL window. The process continues to run in the background and has to be terminated via Task Manager.
I have narrowed the problem down to this line:
Set objCBCtl = myNS.folders.GetFirst.GetExplorer.CommandBars.FindControl(, 5613)
After that line executes OL wont completely close anymore.
Set mySession = CreateObject ("",Outlook.application)
' Also tried GetObject(, "Outlook.Application")
Set myNS = mySession.GetNamespace("MAPI")
Set objCBCtl = myNS.folders.GetFirst.GetExplorer.CommandBars.FindControl(, 5613)
'objCBCtl.execute ' Take Outlook offline
:
:
:
'objCBCtl.execute ' Take Outlook online
Set objCBCtl = Nothing
Set MyFolder = Nothing
Set myNS = Nothing
Set mySession = Nothing
Having the same problem on WinXP and Win7 OL2003 & OL 2010