PDA

View Full Version : Want to use same CommandButton name more than once (ambiguos)



John Texas
12-09-2013, 05:01 PM
I would like to use the same CommandButton name repeatedly in an unlocked Word document. The CommandButton will call a macro. I would like to copy and paste the button repeatedly in the same document. I realize this is an ambiguous object. Microsoft Help seems to suggest using object and module variables is a way but I am lost trying to understand it. Thank you for your help.

(Why I am doing this. I have used Macrobutton fields for many years. They can be copy and pasted. I am trying to switch to a tablet. A CommandButton can be activated with a finger tap but a Macrobutton cannot. In order for me to change to a tablet I would have to replace hundreds of identical macrobutton fields with Command buttons. It would be very easy if all I had to do is paste them in.)

fumei
12-09-2013, 07:22 PM
Commandbuttons must have unique names. If you have three buttons, you must have three names.

fumei
12-09-2013, 07:25 PM
Not only that, but unlike macrobuttons, each commandbutton must have its own separate individual click event.

John Texas
12-09-2013, 08:56 PM
Not only that, but unlike macrobuttons, each commandbutton must have its own separate individual click event.

Thank you for the prompt reply. I'll share some recent experience. I bought a Dell Venue W8.1 tablet with Word 2013 on it. Macros behave in a way I am still trying to get a handle on. Here is what I have discovered.

Dell sells an electronic stylus. It can call a click event by simply hoving very near the screen and pressing a button or by tapping. I also have a non-battery stylus that is capacitive. The results are.

Macrobutton - Will run with an electronic stylus tap but not a capacitive stylus tap. Will not run with finger tap.
Command button - Will run with electronic stylus, capacitive stylus or finger tap.

It seems odd a macrobutton field will not work with a finger tap and a commandbutton will. I also do not know if this is unique to Dell. I'll do some more testing as time passes and will update this thread.
Thanks again.