-
"I see exactly what you are saying which will make it impossible to do what I originally wanted"
No, the code offered does not make it impossible, it does EXACTLY what you originally wanted. What you said you wanted was:
"I am trying to add code to the click event of an activex command button"
The code does precisely that. It is code added to the click event that changes the Caption.
OK, so you posted incorrectly - you do not want code added to the click event. You want code that has nothing to do with the click event. Yes?
"I am thinking of putting the code to change the caption in a separate module" Ok. Why? What exactly do you want anyway? Or perhaps more significantly, WHEN do you want to change the caption? If it is NOT the click event then you do not need the code to find out the control name. Just look it up, and then use it. Then determine WHEN you want the action to happen. And how it is going to happen. What action will cause the code to fire (the Caption to change)? A keyboard shortcut? What?[vba]
ActiveDocument.InlineShapes(3).OLEFormat.Object.Caption = "yadda"
[/vba]The third InlineShape (ActiveX controls are InlineShapes) Caption is changed.
Last edited by fumei; 07-02-2012 at 02:15 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules