Group:  Microsoft Word ยป microsoft.public.word.vba.userforms
Thread: Create Command Button Scripts for Forms

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Create Command Button Scripts for Forms
"Francis Carr" <kccarr[ at ]earthlink.net> 06.07.2006 12:31:46
I have created some forms in MS Word, and was wondering if command buttons
can be created that would allow the user to save the form, print the
document and send an email. I understand that there are buttons on the tool
bars, but a request has been for it to be embedded in the form.
Thanks!
KCCARR


Re: Create Command Button Scripts for Forms
Cindy M -WordMVP- <C.Meister-C[ at ]hispeed.ch> 06.07.2006 15:03:02
Hi Francis,

[Quoted Text]
> I have created some forms in MS Word, and was wondering if command buttons
> can be created that would allow the user to save the form, print the
> document and send an email. I understand that there are buttons on the tool
> bars, but a request has been for it to be embedded in the form.
>
Well, there are the buttons in the Controls Toolbox. These are the same as used
in a UserForm (although the available events might differ in some cases). You'd
need to insert it in-line with the text so that it's available in a protected
form.

The other option is to use a MacroButton field. This is actually my preference,
as the ActiveX controls tend to behave a bit oddly in a Word document. You can
put a graphic in as the "display text" so that it looks like a button. Then run
Application.Options.ButtonFieldClicks = 1

so that it reacts to a single (rather then double) click.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

Re: Create Command Button Scripts for Forms
"Charles Kenyon" <wordfaq[ at ]nospam.addbalance.com> 06.07.2006 16:15:56
Two additional points to those made by Cindy...

What you are talking about is what Word calls an "online form." This is
different from a UserForm which is a custom dialog box. For more about
online forms, follow the links at
http://addbalance.com/word/wordwebresources.htm#Forms or
http://word.mvps.org/FAQs/Customization/FillinTheBlanks.htm especially Dian
Chapman's series of articles.

The second point is that what you want to do does involve vba and/or ActiveX
controls. These will trigger macro security problems that you will need to
address as well.

Hope this helps,
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!

My criminal defense site: http://addbalance.com
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
"Francis Carr" <kccarr[ at ]earthlink.net> wrote in message
news:%23X9IQhPoGHA.2312[ at ]TK2MSFTNGP04.phx.gbl...
[Quoted Text]
>I have created some forms in MS Word, and was wondering if command buttons
>can be created that would allow the user to save the form, print the
>document and send an email. I understand that there are buttons on the
>tool bars, but a request has been for it to be embedded in the form.
> Thanks!
> KCCARR
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net