Hiya guys....

I have created a VB Button into my word document which has a macro attached
to it. But when I print the page I dont want to show the button, How can I
change it so the button only sppears in the page and not on the printed
documents?

Alistaire

Re: VB Buttons by Jonathan

Jonathan
Wed Oct 19 09:14:47 CDT 2005


"LW_Greeney" <LWGreeney@discussions.microsoft.com> wrote in message
news:D6E9490B-FD3B-4C44-8410-9FC089C90F0A@microsoft.com...
> Hiya guys....
>
> I have created a VB Button into my word document which has a macro
> attached
> to it. But when I print the page I dont want to show the button, How can I
> change it so the button only sppears in the page and not on the printed
> documents?
>
> Alistaire
>

How to hide a Print commandbutton on a document form when a user clicks on
it
http://www.word.mvps.org/FAQs/TblsFldsFms/HidePrintButton.htm


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org


Re: VB Buttons by MarcCowlin

MarcCowlin
Mon Nov 14 06:59:09 CST 2005

Jonathan,

Thanks for that link, it was very useful (i had a similar thread like tihis
elsewhere).

However, is it possible to assign a specific name to the object to prevent
any confusion if a user inserts another object, as this will mean that
(depending upon location of the new object) it may be the item that is
temporarily hidden instead of trhe form button.

Thanks


"Jonathan West" wrote:

>
> "LW_Greeney" <LWGreeney@discussions.microsoft.com> wrote in message
> news:D6E9490B-FD3B-4C44-8410-9FC089C90F0A@microsoft.com...
> > Hiya guys....
> >
> > I have created a VB Button into my word document which has a macro
> > attached
> > to it. But when I print the page I dont want to show the button, How can I
> > change it so the button only sppears in the page and not on the printed
> > documents?
> >
> > Alistaire
> >
>
> How to hide a Print commandbutton on a document form when a user clicks on
> it
> http://www.word.mvps.org/FAQs/TblsFldsFms/HidePrintButton.htm
>
>
> --
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
> Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
>
>

Re: VB Buttons by Jonathan

Jonathan
Mon Nov 14 07:35:05 CST 2005


"Marc Cowlin" <MarcCowlin@discussions.microsoft.com> wrote in message
news:695EA73D-9762-44FD-B13A-2047634853B5@microsoft.com...
> Jonathan,
>
> Thanks for that link, it was very useful (i had a similar thread like
> tihis
> elsewhere).
>
> However, is it possible to assign a specific name to the object to prevent
> any confusion if a user inserts another object, as this will mean that
> (depending upon location of the new object) it may be the item that is
> temporarily hidden instead of trhe form button.

Right-click on the shape, select Format Picture from the pop-up menu. select
the Web tab. You can type some text into the Alternative text box, something
like "hide me"

Then the code can be updated like this

Private Sub CommandButton1_Click()
Dim oShape as Shape

For Each oShape in ActiveDocument.Shapes
If oShape.AlternativeText = "hide me" Then
oShape.Visible = msoFalse
End If
Next oShape
ActiveDocument.PrintOut Background:=False

For Each oShape in ActiveDocument.Shapes
If oShape.AlternativeText = "hide me" Then
oShape.Visible = msoTrue
End If
Next oShape

End Sub


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org