0
votes

I created a macro for a document. I want a button so that anyone can run the macro easily.

I only want the button to appear on that document, and when I share the document the button appears.

I tried using the built-in File -> Options method to add the button, but the result is that

a) the button isn't shown when I send the document to others

b) it appears when I open any Word document

1
'File > Options method'- what do you mean by that? Have you tried button available in Developer tab >> controls >> command button ??Kazimierz Jawor
Thanks @KazJaw, what I did was go File -> Options -> Customise Ribbon, then select 'Macros' and then chose my macro from a list and added it to the 'Home' tab. But then I get the symptoms above. How would using the Developer tab help?user1711233
so, you want to add button on the ribbon tab which is on only for that document?Kazimierz Jawor

1 Answers

0
votes

With the code in "ThisDocument" you can add a "button" to the document rather than the ribbon.

http://wordribbon.tips.net/T008658_Assigning_a_Macro_to_a_Button_in_Your_Text.html

"This is all instituted through the use of a field code.

It may be a bit of a misnomer to refer to the result of this field code as a "button," because no graphics are involved whatsoever, although you can create your own graphic and embed it into the field.

The syntax for the field code is: MacroButton MacroName Display"

If the final document should not have a button, you could revise the code to first generate a new document without the button.