#1   Report Post  
LW_Greeney
 
Posts: n/a
Default VB Command Button

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
  #2   Report Post  
Jay Freedman
 
Posts: n/a
Default VB Command Button

LW_Greeney wrote:
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


See http://word.mvps.org/FAQs/TblsFldsFm...rintButton.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


  #3   Report Post  
LW_Greeney
 
Posts: n/a
Default VB Command Button

hi jay,

have have done what it says, but i have more than one button within all the
document, have have 6 pages with buttons on each?
does this work for all buttons?

"Jay Freedman" wrote:

LW_Greeney wrote:
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


See http://word.mvps.org/FAQs/TblsFldsFm...rintButton.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org



  #4   Report Post  
Jay Freedman
 
Posts: n/a
Default VB Command Button

Do all the buttons do the same thing -- print the entire document? Or do
they have separate functions, like printing the current page? In fact, do
they print at all, or do their macros do something else?

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

LW_Greeney wrote:
hi jay,

have have done what it says, but i have more than one button within
all the document, have have 6 pages with buttons on each?
does this work for all buttons?

"Jay Freedman" wrote:

LW_Greeney wrote:
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


See http://word.mvps.org/FAQs/TblsFldsFm...rintButton.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org



  #5   Report Post  
LW_Greeney
 
Posts: n/a
Default VB Command Button

There is only 1 button that prints, then the rest are just buttons to move
about the document! All buttons are macros going to a different bookmark on
the document.

I know in excel there is an option called printobject which you can change
to failse but i cannot find that in word.

"Jay Freedman" wrote:

Do all the buttons do the same thing -- print the entire document? Or do
they have separate functions, like printing the current page? In fact, do
they print at all, or do their macros do something else?

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

LW_Greeney wrote:
hi jay,

have have done what it says, but i have more than one button within
all the document, have have 6 pages with buttons on each?
does this work for all buttons?

"Jay Freedman" wrote:

LW_Greeney wrote:
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

See http://word.mvps.org/FAQs/TblsFldsFm...rintButton.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org






  #6   Report Post  
Jay Freedman
 
Posts: n/a
Default VB Command Button

There is an option labeled "Drawing objects" on the Print tab of the Tools
Options dialog that controls whether Word prints the drawing objects in the
document. For this purpose, drawing objects include text boxes as well as
pictures, AutoShapes, and other graphics.

If the text boxes containing the command buttons are the only drawing
objects in the document, you could uncheck that option and print, and none
of the text box/command button objects would be printed.

To do this automatically, open the macro attached to the button that prints,
and put this code between the Sub line and the End Sub line:

' declare a variable
Dim bOptPrintDrawings As Boolean

' save the existing option value
bOptPrintDrawings = Options.PrintDrawingObjects
Options.PrintDrawingObjects = False

' print the document
ActiveDocument.PrintOut Background:=False

' restore the option to original value
Options.PrintDrawingObjects = bOptPrintDrawings

If your document has other drawing objects, then we'll have to do something
more complicated. If that's the case, are these six the only text boxes in
the document?

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

LW_Greeney wrote:
There is only 1 button that prints, then the rest are just buttons to
move about the document! All buttons are macros going to a different
bookmark on the document.

I know in excel there is an option called printobject which you can
change to failse but i cannot find that in word.

"Jay Freedman" wrote:

Do all the buttons do the same thing -- print the entire document?
Or do they have separate functions, like printing the current page?
In fact, do they print at all, or do their macros do something else?

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

LW_Greeney wrote:
hi jay,

have have done what it says, but i have more than one button within
all the document, have have 6 pages with buttons on each?
does this work for all buttons?

"Jay Freedman" wrote:

LW_Greeney wrote:
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

See http://word.mvps.org/FAQs/TblsFldsFm...rintButton.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org



  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Richard Richard is offline
external usenet poster
 
Posts: 150
Default VB Command Button

I have jumped into this thread because I have a similar problem. I have only
one command button which does various things. However, the user will print
via the normal means Ctrl P, Print, etc. However, I don't want to print the
command button, but do want to print graphics, text boxes, (JPG's, etc).

"Jay Freedman" wrote:

There is an option labeled "Drawing objects" on the Print tab of the Tools
Options dialog that controls whether Word prints the drawing objects in the
document. For this purpose, drawing objects include text boxes as well as
pictures, AutoShapes, and other graphics.

If the text boxes containing the command buttons are the only drawing
objects in the document, you could uncheck that option and print, and none
of the text box/command button objects would be printed.

To do this automatically, open the macro attached to the button that prints,
and put this code between the Sub line and the End Sub line:

' declare a variable
Dim bOptPrintDrawings As Boolean

' save the existing option value
bOptPrintDrawings = Options.PrintDrawingObjects
Options.PrintDrawingObjects = False

' print the document
ActiveDocument.PrintOut Background:=False

' restore the option to original value
Options.PrintDrawingObjects = bOptPrintDrawings

If your document has other drawing objects, then we'll have to do something
more complicated. If that's the case, are these six the only text boxes in
the document?

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

LW_Greeney wrote:
There is only 1 button that prints, then the rest are just buttons to
move about the document! All buttons are macros going to a different
bookmark on the document.

I know in excel there is an option called printobject which you can
change to failse but i cannot find that in word.

"Jay Freedman" wrote:

Do all the buttons do the same thing -- print the entire document?
Or do they have separate functions, like printing the current page?
In fact, do they print at all, or do their macros do something else?

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

LW_Greeney wrote:
hi jay,

have have done what it says, but i have more than one button within
all the document, have have 6 pages with buttons on each?
does this work for all buttons?

"Jay Freedman" wrote:

LW_Greeney wrote:
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

See http://word.mvps.org/FAQs/TblsFldsFm...rintButton.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org




  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default VB Command Button

Hi Richard,

The solution I'll recommend for you is not the one discussed earlier in this
thread. You should instead look at the article
http://word.mvps.org/FAQs/MacrosVBA/...tSavePrint.htm, which explains
that macros with specific names will execute instead of the built-in
commands. You should give your command button a name, and the
print-intercepting macros can then hide the button or change its color to
white, print the document, and then restore the button's appearance.

Actually, a better solution would be to create a custom button on a toolbar
in your template, instead of a command button in the document body. That
way, you never have to worry about the printing issue. See
http://www.word.mvps.org/FAQs/Custom...oToToolbar.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Richard wrote:
I have jumped into this thread because I have a similar problem. I
have only one command button which does various things. However, the
user will print via the normal means Ctrl P, Print, etc. However, I
don't want to print the command button, but do want to print
graphics, text boxes, (JPG's, etc).



  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Richard Richard is offline
external usenet poster
 
Posts: 150
Default VB Command Button

Hi Jay,

Pretty much as I suspected. The first link has helped me out greatly. I did
not know how to do this. Thanks.

Before you replied, I did resort to a macro from a cutom button on the menu
bar. But because the document is being used by work colleagues who will be
less familiar with Word, macros and the document, i was worried that they may
forget to run the macro so instead there is a big command button where it is
needed. Thus I will use your first technique proposed and resort to the less
favoured solution of 'hiding' the command button temporarily. Many thanks.

Regards,

Richard

"Jay Freedman" wrote:

Hi Richard,

The solution I'll recommend for you is not the one discussed earlier in this
thread. You should instead look at the article
http://word.mvps.org/FAQs/MacrosVBA/...tSavePrint.htm, which explains
that macros with specific names will execute instead of the built-in
commands. You should give your command button a name, and the
print-intercepting macros can then hide the button or change its color to
white, print the document, and then restore the button's appearance.

Actually, a better solution would be to create a custom button on a toolbar
in your template, instead of a command button in the document body. That
way, you never have to worry about the printing issue. See
http://www.word.mvps.org/FAQs/Custom...oToToolbar.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Richard wrote:
I have jumped into this thread because I have a similar problem. I
have only one command button which does various things. However, the
user will print via the normal means Ctrl P, Print, etc. However, I
don't want to print the command button, but do want to print
graphics, text boxes, (JPG's, etc).




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:39 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"