I can STOP Outlook nicely, but why is it so damn hard to get it up running again !
This snip of code says Outlook is already in use .... and it is NOT - I've seen it stop by stepping through the code !
What do I do wrong ?
This snip of code says Outlook is already in use .... and it is NOT - I've seen it stop by stepping through the code !
Code:
Set objOutlook = CreateObject("Outlook.Application")
objOutlook.Quit
.
(some more code for copying !)
.
.
.
Msgbox "Start Outlook again !"
OpenOutlook
Sub OpenOutlook()
Dim oApp
Dim oName
Dim oFolder
Set oApp = CreateObject("Outlook.Application")
Set oName = oApp.GetNamespace("MAPI")
' OName.Logon "Default Outlook Profile",, False, True
' Set oFolder = oName.GetDefaultFolder(6)
' oFolder.Display
OApp.ActiveExplorer.Activate
Set oApp = Nothing
Set oName = Nothing
Set oFolder = Nothing
End Sub