Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: ObjectCreate ObjectGet Existing Instance Create New Object
; Setup connection to Outlook myOlApp = ObjectCreate("Outlook.Application") myExplorer = myOlApp.ActiveExplorer myOlExp = myOlApp.ActiveExplorer If myOlExp == 0 Then Exit ; Outlook not runningIn some cases my script is a little slow to exit and some users may try to re-run the compiled script. Is there a faster way to detect if Outlook is running (across all versions)?
; Check if Outlook is already running ErrorMode(@OFF) objOutlook = ObjectGet(,"Outlook.Application") ErrorMode(@CANCEL) error = LastError() If objOutlook == 0 && error == 1129; Outlook is not already running Pause('Notice','Outlook not already running, creating an instance') objOutlook = ObjectCreate("Outlook.Application"); Create an instance of Outlook EndIf Pause('Notice','Add code to deal with Outlook') objOutlook = 0 Exit
Article ID: W18096
Filename: Use Existing Instance Or Create a New One If Necessary.txt
File Created: 2011:01:27:11:56:52
Last Updated: 2011:01:27:11:56:52