Need VBA Code for Status Bar Message

C

Cathy

Hi,

I have a macro that searches and replaces a lot of company-specific
terminology. It's difficult to know whether the macro is working or not,
because you don't get an hour glass or anything. I've added a message box
that states when the macro is completed, but now I would like to add a
message in the status bar that states that the macro is in progress (or some
sort of message somewhere stating that the macro is in progress). Some of
the presentations that the macro has to search through are large and it
would be helpful for the user to know that the macro is really going and
that they haven't bombed out.

I've put this code in Word macros before, but I'm not sure how to do it in
PowerPoint, or if it is even possible. Any help would be greatly
appreciated. Thanks for your time!

Cathy
 
B

Brian Reilly, MS MVP

Cathy,
Shyam may correct me but I don't think Application.StatusBar is
available in any version of PPT yet.

Depending on which version you are using you might be able to throw up
a modal textbox to perform the same function. Shyam or Chirag, you
guys sitting on any sample code for this. I'm not since I've been
buried in SQL Server and IIS lately (g).

Cathy, reply with what version of PPT you are using since modal
textboxes are relatively new.

Brian Reilly, PowerPoint MVP
 
C

Chirag

I guess the best solution would be to show the status messages in non-modal
user forms. Create a user form with a textbox on it to hold the status
messages. Show the user form using something like:

UserForm.Show vbModeless

Update the textbox on the user form with status messages at appropriate
intervals. Sprinkle the code with some "DoEvents" - one atleast after
updating the status textbox. When you are done with searching, hide the user
form with:

UserForm.Hide

If you are not going to use the userform again, might as well unload it:

Unload UserForm

If you really really want to update the status bar, Win32 API could probably
be used.

- Chirag

PowerShow - View multiple shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
C

Cathy

Sorry, I meant to state what version of PowerPoint I was using in my
original message. It's 2002.
 
C

Cathy

Hi Chirag,

I followed your instructions below and all except one thing is working well.
The userform shows up while the macro is running in the background and then
unloads at the right time. The only problem that I'm having is with the
text that is in the text box of the user form. It is not showing up when
the userform displays. The userform with its caption displays, but the area
where the message is supposed to be is blank. I've looked at everything I
can think of to try and figure out why this is happening -- font color,
background color, etc. I thought maybe I needed to "bring to front" or
"send to back" the text box, but all of the options for doing this (toolbar
and menu) are dimmed out.

In further testing, I switched the userform from being modeless to modal to
see if the text would show when the form displayed and it did. But, when I
put the form back to modeless, the text will not show. Do you have any idea
why this is happening?

Cathy
 
C

Cathy

Hi Chirag,

Everything is working now. It was my own fault, because I neglected to put
in the "do events" that you mentioned in your initial response to me.

Thank you so much for your help, and for helping me to learn more about
VBA!!

Cathy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top