PDA

View Full Version : Solved: How to hide the command button



megha
10-30-2009, 06:42 AM
I have a created macro that save and email a word document. I want to have the command button to go away (disappeared) after the actions are done. Can someone please suggest me the code to disaapear command button on word. The one I know is CommandButton1.Visible = False but it does not working. Thanks in advance.

lucas
10-30-2009, 08:24 AM
Are you using a template?

megha
10-30-2009, 08:35 AM
No, I am not using template.

lucas
10-30-2009, 08:41 AM
What version of Word are you using?

The problem with a command button on the page is that when you email the document it will still contain the code and the button even if it's hidden.

It is best to run your code from a menu item and from within a template. That way, neither the menu ited or the code will go with the cloned document that you email.

How to run your code from a menu item in Version 2003 and before (http://slucas.virtualave.net/Wink/CustomMenuItem.htm)

fumei
11-03-2009, 09:43 AM
A menu item, or a shortcut key, would eliminate having the button, if the purpose to execuet something but not have a button afterwards.

You do not state if this a a MACROBUTTON (field), or a ActiveX CommandButton (control).