
How to use current outlook?
Quote:
> I go a bit farther:
> Dim objOA As Object
> Set objOA = Outlook.Application
> If TypeName(objOA) = "Nothing" Then
> Dim objOL As Object
> objOL = CreateObject("Outlook.Application")
> Set objOA = New Outlook.Application
> End If
> Is this a reasonable solution? Or would GetObject create one if none were
> found to exist?
You are getting confused. If GetObject or CreateObject work then you do not
do a set.
Dim objOA as Object
objOA = GetObject("Outlook.Application")
If TypeName(objOA) = "Nothing" then
objOA = CreateObject("Outlook.Application")
End if
An alternative approach: Just do the CreateObject, get the Explorer
collection object, and pull out the first Explorer Item from the collection.
That will be the pre-existing Outlook explorer. Get the Application object
from there. Dismiss your created application object.