Word form: hide commandbutton

G

Graham Mayor

Frankly Active X controls are best left to the web pages they were intended
for.

The problem for this type of control is that you have to activate macros,
and you have no control over users' willingness to run macros. Beyond that -
and assuming that you inserted the button into a text box as instructed, it
should work in a protected form - and does here without issue.

If you are creating the form in Word 2003, then it would be better to create
a floating toolbar for the print command. Toolbars don't print nor require
macros. If you are creating for Word 2007 and know that users will have this
application, then I would add a ribbon tab to the document and put the
button on that tab. http://gregmaxey.mvps.org/Customize_Ribbon.htm

There is no universal solution that all users will be able to adopt.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
D

Dale

Interesting, I took the example from the website I referenced earlier,
protected it and had to click repeatedly on the commandbutton to get it
to fire. I agree with you, getting users to enable macros is
problematic, I'm not sure I can get away with not doing this...the
commandbutton is not the only item using macros, I have a userform as
well....unless I really dummy down the form.

Are you saying if I assign all my macros to a toolbar I
won't get the enable macros warning and the toolbar will function? For
instance the print commandbutton prints only the current page, I can
accomplish the same thing with a toolbar?

I have users using Word 2000 to 2007 to further complicate things.
thanks
--

Graham Mayor wrote:
Frankly Active X controls are best left to the web pages they were
intended for.

The problem for this type of control is that you have to activate
macros, and you have no control over users' willingness to run
macros. Beyond that - and assuming that you inserted the button into
a text box as instructed, it should work in a protected form - and
does here without issue.

If you are creating the form in Word 2003, then it would be better to
create a floating toolbar for the print command. Toolbars don't print
nor require macros. If you are creating for Word 2007 and know that
users will have this application, then I would add a ribbon tab to
the document and put the button on that tab.
http://gregmaxey.mvps.org/Customize_Ribbon.htm

There is no universal solution that all users will be able to adopt.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Hello,
I'm using this method to hide a commandbutton on a Protected word
form: http://word.mvps.org/faqs/tblsfldsfms/HidePrintButton.htm
This method works well with an unprotected form, but with the
protected form I have to repeatedly click on the commandbutton to
get it to fire. Have I done something wrong?? Any suggestions?
Thanks
--
 
D

Doug Robbins - Word MVP

In Word 2003 and earlier, which I assume you are using because of the
reference to toolbars, there is a Print command (the one without the ...
after it under the File Section of the Commands listed in the Customize
dialog) that just prints the current page. So, no macro is needed for that.

If you have a userform in your application however, you cannot avoid macros
and the application would normally be then created as a template and you
should distribute it to other users using the method shown in the article
"Distributing macros to other users” at:

http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
D

Dale

The form lives on our intranet...I'm developing the template in word
2007, but my users have everything from office 2k to office 2007. I've
provided the users with instructions on the first page with the actual
"form" on the second page, hence the reason for the command button
mentioned in the earlier posts. If the user doesn't enable macros, I
can still capture the data needed and then import into a
database...some of the rationale behind the macros was to save the
document with a standard title and email to the keeper of the database
with a standard subject line.


--



Doug Robbins - Word MVP wrote:
In Word 2003 and earlier, which I assume you are using because of the
reference to toolbars, there is a Print command (the one without the
.... after it under the File Section of the Commands listed in the
Customize dialog) that just prints the current page. So, no macro is
needed for that.

If you have a userform in your application however, you cannot avoid
macros and the application would normally be then created as a
template and you should distribute it to other users using the method
shown in the article "Distributing macros to other users” at:

http://www.word.mvps.org/FAQs/MacrosVBA/DistributeMacros.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

Interesting, I took the example from the website I referenced
earlier, protected it and had to click repeatedly on the
commandbutton to get it to fire. I agree with you, getting users
to enable macros is problematic, I'm not sure I can get away with
not doing this...the commandbutton is not the only item using
macros, I have a userform as well....unless I really dummy down the
form.

Are you saying if I assign all my macros to a toolbar I
won't get the enable macros warning and the toolbar will function?
For instance the print commandbutton prints only the current page,
I can accomplish the same thing with a toolbar?

I have users using Word 2000 to 2007 to further complicate things.
thanks
--
Graham Mayor wrote:
Frankly Active X controls are best left to the web pages they were
intended for.

The problem for this type of control is that you have to activate
macros, and you have no control over users' willingness to run
macros. Beyond that - and assuming that you inserted the button into
a text box as instructed, it should work in a protected form - and
does here without issue.

If you are creating the form in Word 2003, then it would be better
to create a floating toolbar for the print command. Toolbars don't
print nor require macros. If you are creating for Word 2007 and
know that users will have this application, then I would add a
ribbon tab to the document and put the button on that tab.
http://gregmaxey.mvps.org/Customize_Ribbon.htm

There is no universal solution that all users will be able to adopt.

-- <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>



Hello,
I'm using this method to hide a commandbutton on a Protected word
form: http://word.mvps.org/faqs/tblsfldsfms/HidePrintButton.htm
This method works well with an unprotected form, but with the
protected form I have to repeatedly click on the commandbutton to
get it to fire. Have I done something wrong?? Any suggestions?
Thanks
--
 
G

Graham Mayor

As Doug has said, if you have other macros then the additional macro does
not of itself create a problem. I cannot see why you would have to
repeatedly click the button, unless the supporting macro is accessing a
different shape in the dcoument from

With ActiveDocument
.Shapes(1).Visible = msoFalse
.PrintOut Background:=False
.Shapes(1).Visible = msoTrue
End With

but then it shouldn't work at all.

As your form is only page 2 of your document, you could put the button(s) on
page 1 and use the button to print page 2 and then the problem of hiding it
shouldn't arise.

I don't know if it will further your project but see
http://www.gmayor.com/ExtractDataFromForms.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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