H
Howard Kaikow
It is my understanding that Outlook is a single instance app, i.e., there
can be only a single instance of Outlook running.
I've been using code such as the following:
'Get existing instance of Outlook ; otherwise create a new one
' Outllok is a single instance application
On Error Resume Next
Set appOuttlook= GetObject(, "Outlook.Application")
If Err.Number = 0 Then
blnNew = False
Else
Set appOutlook= New Outlook.Application
blnNew = True
End If
On Error Goto 0
and then
With appOutlook
If blnNew Then
.Quit
Else
' Finish of macro, but leave Outlook running
End If
End With
However, I suspect that code may not be good enough.
If I created the NEW Outlook instance in code, how can I determine whether
the instance is not being by somebody outside of my code? Somebody could
have started Outlook session whilst my code is running, AFTER I created the
NEW Outlook?
Is the only choice to leave Outlook running?
can be only a single instance of Outlook running.
I've been using code such as the following:
'Get existing instance of Outlook ; otherwise create a new one
' Outllok is a single instance application
On Error Resume Next
Set appOuttlook= GetObject(, "Outlook.Application")
If Err.Number = 0 Then
blnNew = False
Else
Set appOutlook= New Outlook.Application
blnNew = True
End If
On Error Goto 0
and then
With appOutlook
If blnNew Then
.Quit
Else
' Finish of macro, but leave Outlook running
End If
End With
However, I suspect that code may not be good enough.
If I created the NEW Outlook instance in code, how can I determine whether
the instance is not being by somebody outside of my code? Somebody could
have started Outlook session whilst my code is running, AFTER I created the
NEW Outlook?
Is the only choice to leave Outlook running?