Pausing a macro for user selection ...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all

(Re. Windows XP

I have created a template that has a customized toolbar attached to it. I would like to add a button to this toolbar to invoke a macro. The macro will be Insert / Picture / [navigate to applicable folder]. So far so good. I want the macro to pause while the user chooses a picture. This is where I get stuck! At this point in the macro creation I cannot get at the macro pause button. I know this is possible. What am I doing wrong (or not doing ...) HELP

Thanks

Sharon
 
Simplest way to browse for a file within a macro is to use a form with a
commondialog control on it. The form needn't be visible. When you call the
commondialog it displays the Explorer Select file(s) dialog and waits for
the user to select or cancel.


Sharon said:
Hi all,

(Re. Windows XP)

I have created a template that has a customized toolbar attached to it. I
would like to add a button to this toolbar to invoke a macro. The macro will
be Insert / Picture / [navigate to applicable folder]. So far so good. I
want the macro to pause while the user chooses a picture. This is where I
get stuck! At this point in the macro creation I cannot get at the macro
pause button. I know this is possible. What am I doing wrong (or not doing
....) HELP.
 
Hi =?Utf-8?B?U2hhcm9u?=,
I have created a template that has a customized toolbar attached to it. I would like to add a button to this toolbar to invoke a macro. The macro will be Insert / Picture / [navigate to applicable folder]. So far so good. I want the macro to pause while the user chooses a picture. This is where I get stuck! At this point in the macro creation I cannot get at the macro pause button. I know this is possible. What am I doing wrong (or not doing ...) HELP.
Unlike WordPerfect, Word's macros can't be "paused". The macro would have to stop completely, then the user would have to start a second macro to complete the action.

In this case, however, you don't need that. If your macro explicitly shows the dialog box it will pause all on its own, waiting for the user to dismessthe dialog box.:
Application.Dialogs(wdDialogInsertPicture).Show

Note: you'll get faster answers to macro questions by posting in one of the word.vba groups. In your case, I'd say you probably need Word.vba.gebinners

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-)
 
Back
Top