Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Macro buttons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Anderson - 04 Jan 2006 20:32 GMT
I have several forms that I have made up.  They have a control toolbox button
that is set as a macro for different functions.  They all work fine but I
don't want these buttons to show when I print the document.  Is there a way
to hide them or not have them show in the print?
Dawn Crosier - 04 Jan 2006 22:01 GMT
This article should help get you going:
http://word.mvps.org/faqs/tblsfldsfms/HidePrintButton.htm

Let us know if you need more help.

Signature

Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.

>I have several forms that I have made up.  They have a control
>toolbox button
[quoted text clipped - 3 lines]
> there a way
> to hide them or not have them show in the print?
Mike Anderson - 04 Jan 2006 23:28 GMT
I have tried the text box but my macro doesn't work after that.  I am using
the MVP spellcheck and it works until I put it in the text box.  The line
that doesn't work is this:
oDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="anderson12"

It prompts me to insert   = 2  after FormFields but that doesn't work
either.  Any ideas on how to make it work?  Or is there another way to do
this.

Thanks You
Mike

> This article should help get you going:
> http://word.mvps.org/faqs/tblsfldsfms/HidePrintButton.htm
[quoted text clipped - 8 lines]
> > there a way
> > to hide them or not have them show in the print?
Dawn Crosier - 06 Jan 2006 17:18 GMT
Mike -

What version of Word are you using?  Are you saying that the button
that you put inside the text box no longer works after you put it in
the Textbox or are you saying that the spell check code itself no
longer works?

I'm a little confused.

Signature

Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.

>I have tried the text box but my macro doesn't work after that.  I am
>using
[quoted text clipped - 26 lines]
>> > there a way
>> > to hide them or not have them show in the print?
Mike Anderson - 06 Jan 2006 17:46 GMT
The button itself works when I put the botton in the text box. But the spell
check code no longer works.  It stops at this point.

oDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="anderson12"

> Mike -
>
[quoted text clipped - 35 lines]
> >> > there a way
> >> > to hide them or not have them show in the print?
Doug Robbins - Word MVP - 06 Jan 2006 18:19 GMT
Is that code all on one line in the macro?  If it is as shown in your
message you need to add a visual basic carriage return (space+_) after True,

oDoc.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, _
Password:="anderson12"

Signature

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

> The button itself works when I put the botton in the text box. But the
> spell
[quoted text clipped - 42 lines]
>> >> > there a way
>> >> > to hide them or not have them show in the print?
Mike Anderson - 06 Jan 2006 19:33 GMT
No it is all on one line it just gets cut in this forum here.  When I mouse
over it it prompts me to add =2 after wdAllowFormFields but that doesn't work
either.

Thanks for your help.
Mike

> Is that code all on one line in the macro?  If it is as shown in your
> message you need to add a visual basic carriage return (space+_) after True,
[quoted text clipped - 48 lines]
> >> >> > there a way
> >> >> > to hide them or not have them show in the print?
Doug Robbins - Word MVP - 06 Jan 2006 21:22 GMT
The following certainly works for me

ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="test"

Are you sure that oDoc is referencing a document?

Signature

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

> No it is all on one line it just gets cut in this forum here.  When I
> mouse
[quoted text clipped - 58 lines]
>> >> >> > there a way
>> >> >> > to hide them or not have them show in the print?
Mike Anderson - 07 Jan 2006 00:16 GMT
I tried ActiveDocument instead of the oDoc and it does the same.  it stops
right there.

Thank you for your help.  
Mike

> The following certainly works for me
>
[quoted text clipped - 65 lines]
> >> >> >> > there a way
> >> >> >> > to hide them or not have them show in the print?
Doug Robbins - Word MVP - 07 Jan 2006 10:35 GMT
Are you sure that in your code you have wdAllowOnlyFormFields and not
wdAllowFormFields?  In your post you use both.

Signature

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

>I tried ActiveDocument instead of the oDoc and it does the same.  it stops
> right there.
[quoted text clipped - 78 lines]
>> >> >> >> > there a way
>> >> >> >> > to hide them or not have them show in the print?
Mike Anderson - 09 Jan 2006 19:31 GMT
Yes I have wdAllowOnlyFormFields.  I must have made a typo in one of my
posts.  It should be noted that the macro worked fine untill I put it in the
text box.

> Are you sure that in your code you have wdAllowOnlyFormFields and not
> wdAllowFormFields?  In your post you use both.
[quoted text clipped - 81 lines]
> >> >> >> >> > there a way
> >> >> >> >> > to hide them or not have them show in the print?
Dawn Crosier - 06 Jan 2006 22:50 GMT
The number 2 is referring to the value of the constant. For
compatibility it is better to refer to the constant rather than the
value, although either will work.

From Help:
WdProtectionType can be one of these WdProtectionType constants.

wdAllowOnlyComments

wdAllowOnlyFormFields

wdAllowOnlyReading

wdAllowOnlyRevisions

wdNoProtection

Regarding why your code will stop running at the protection line.  Is
your document protected at that point or is it unprotected?

Signature

Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"

This message is posted to a newsgroup. Please post replies and
questions to the newsgroup so that others can learn as well.

> No it is all on one line it just gets cut in this forum here.  When
> I mouse
[quoted text clipped - 70 lines]
>> >> >> > there a way
>> >> >> > to hide them or not have them show in the print?
Mike Anderson - 07 Jan 2006 00:13 GMT
when the code stops and I end it, it is unprotected.

Thanks Mike

> The number 2 is referring to the value of the constant. For
> compatibility it is better to refer to the constant rather than the
[quoted text clipped - 90 lines]
> >> >> >> > there a way
> >> >> >> > to hide them or not have them show in the print?
Mike Anderson - 06 Jan 2006 18:02 GMT
sorry.  running XP Pro with Office XP Pro and Office 97 Pro.  not sure which
one is working.

Thanks Mike

> Mike -
>
[quoted text clipped - 35 lines]
> >> > there a way
> >> > to hide them or not have them show in the print?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.