Check if outlook running in VBA

Peter.Stevens2

Board Regular
Joined
Sep 16, 2008
Messages
56
Hi,
I am trying to establish if Outlook 2000 is currently running in VBA , I have tried the following code but this only works when the user is actually positioned in "Inbox - Microsoft Outlook" etc. At this point I don't really care where/what the user has open in Outlook but merely to check if outlook is running.
I have tried below but does not work robustly enough.
I have also tried AppActivate("Microsoft Outlook")
I have also tried IsRunning("Outlook.Application") which does not even compile.
Code:
Dim OutlookErr, OutlookBox
On Error GoTo OutlookIsNotRunning
AppActivate ("outlook")
GoTo now_send_email

OutlookIsNotRunning:

OutlookErr = "Outlook is either not open or busy with another task." & vbCrLf & vbCrLf
OutlookErr = OutlookErr & "Please Open Outlook, Close any draft emails," & vbCrLf & vbCrLf
OutlookErr = OutlookErr & "the Global Address List or other activities and try again."
OutlookBox = MsgBox(OutlookErr, vbCritical, "Unable to access Outlook to send email")
Exit Sub
[COLOR=black]now_send_email: [/COLOR]

Thanks in advance for your help!

 
HI All,

I was just wondering if anyone knew how to check if the email send was successfull or not ?

Like maybe one could check the vaue of MyMail for a specific value.

Could be that the email supplied to the SendMail routine could be bad ?

When you sending several thousand email it would be useful ?

Thanks in Advance ?
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,215,065
Messages
6,122,944
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top