VBA code to go from one macrobutton to another one

C

cyberdude

Hi,

I have several macrobuttons in a document and a few of these examples
are "name", "address", "phone no". They are coded in the form of
{macrobutton nomacro XXXX} which acts as a text holder.

I want to write a VBA code to do the following:

1.) jump from one macrobutton to another one
2.) it prompts me for an input using a message box and that input can
replace the macrobutton. For example, "name" above will be replaced
by John, etc.

Can anyone help me with the above?

Thank you.

David
 
L

Lene Fredborg

Why not skip the macro solution in this case and let the users go from field
to field using F11. You can let the text in each MacroButton field explain
what to do (e.g. [enter name]). F11 selects the next field and the user can
just type the desired text which will replace the MacroButton field.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
C

cyberdude

Why not skip the macro solution in this case and let the users go from field
to field using F11. You can let the text in each MacroButton field explain
what to do (e.g. [enter name]). F11 selects the next field and the user can
just type the desired text which will replace the MacroButton field.

--
Regards
Lene Fredborg
DocTools - Denmarkwww.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word

Thanks for your message.
Will you please tell me how to insert a field? Thanks again.

David
 
L

Lene Fredborg

MacroButtons _are_ fields. In your document, try to press F11. This should
bring you to the next field which may be one of your MacroButton fields - if
you have other types of fields (e.g. cross-references) in your document, F11
will also stop at those fields.

In general, you can insert fields via Insert > Field or you can press
Ctrl+F9 to insert a pair of field braces and then type the relevant field
code between the braces.

See also:
http://www.word.mvps.org/FAQs/TblsFldsFms/UsingMacroButton.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


cyberdude said:
Why not skip the macro solution in this case and let the users go from field
to field using F11. You can let the text in each MacroButton field explain
what to do (e.g. [enter name]). F11 selects the next field and the user can
just type the desired text which will replace the MacroButton field.

--
Regards
Lene Fredborg
DocTools - Denmarkwww.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word

Thanks for your message.
Will you please tell me how to insert a field? Thanks again.

David
 

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