Change mouse pointer to hourglass, then back

L

Lloyd Catlett

I select a commandbox on a form that starts a sub with some time-consuming
loops; I want to change the mouse pointer to hourglass.

I've tried this:

MousePointer = fmMousePointerHourGlass
lots of time-consuming code
MousePointer = fmMousePointerDefault
Application.ScreenRefresh

No change in the pointer.

Word 2003, XP

Any suggestions??
 
J

Jay Freedman

MousePointer is a property of the command button, not of the window or
of the application. That means you *must* qualify it by prefixing it
with 'CommandButton1.' or whatever the name of the button is:

CommandButton1.MousePointer = fmMousePointerHourGlass
lots of time-consuming code
CommandButton1.MousePointer = fmMousePointerDefault

Also, you'll see the hourglass cursor only when the mouse pointer is
positioned on the button, not anywhere else in the form.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
L

Lloyd Catlett

Thanks! After making the change suggested, the mouse pointer only changes to
hourglass after I do a left mouse click somewhere on the screen. What can I
do to make it change without doing the mouse click?

By the way, after that mouse click to get the hourglass to show, the
hourglass stays no matter where I am positioned on the screen. It only goes
away if I change windows.
 
J

Jay Freedman

I can't answer those questions without seeing the document or template
involved -- what the code looks like, and where in the structure the
macro is stored. If you want to zip it and mail it to me, I'll take a
look.
 

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