Advertisement
Guest User

Untitled

a guest
Feb 28th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. On Error Resume Next
  2.  
  3. ' Try to get running instance of Outlook
  4. Set outApp = GetObject(, "Outlook.Application")
  5.  
  6. If Err.Number=429 Then
  7.     Err.Clear
  8.     MsgBox "Outlook isn't running so I'll try and start it"
  9.     Set outApp = CreateObject("Outlook.Application")
  10.     ' Check to see if Outlook started or not
  11.     If outApp Is Nothing Then
  12.         MsgBox "Outlook didn't start, sorry!"
  13.     Else
  14.         MsgBox "Looks like Outlook was started okay!"
  15.     End If
  16. Else   
  17.     MsgBox "Outlook is already running, so I won't do anything"
  18. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement