views:

462

answers:

2

What's the best practice for indicating to the user that a Macro is running within Outlook ? The macro can take around 1-30 seconds to complete.

I want to avoid a modal 'msgbox' popping up before the macro is run, as this can be annoying.

I would rather avoid the hourglass cursor if possible, and wondered if there was a better way.

Is there a way of placing a non-modal 'status' message up, whilst the macro is running?

(The macro I have runs against the currently selected mailItem - and it launched by a button on the Quick Access Toolbar).

+1  A: 

Hi,

Couple of things that string to mind, I am sure other will have ideas as well.

1.Show a form with a progress bar on it that reports progress or has the progress bar in marque mode if you can’t report progress 2.Show a form with a picture box with your favourite animated gif inside(spinny pizza etc.). You can turn off the buttons etc. 3. Use win api to get play with the outlook staus bar

Not knowing what you are doing in your macro you may have to deal with keeping the form “On top” and pumping async progress into it.

Cheers

Marcus

76mel
+2  A: 

This article (also this) on best practice says use the status bar. This article on Outlook says:

Changing the Status Bar
There is no way to change the status bar text in Microsoft Outlook. The status bar is not exposed as it is in other Microsoft Office object models.

Outlook.com provides code for a progress box

Remou
Remou, you are correct that the status bar is not exposed via OOM but you can use Win Api to manipulate it.
76mel