commande button - please help!!!

E

Evens

Hi,

I've already post a question here but no one can say me how it can be. At
least a response like "no you cant do it" would be ok cause I will stop to
seach.

I have a word document where I have a form in the first page. In the second
page, I have the TOC and 2 buttons on top of it. The first button was used to
update the TOC and the second was used to insert the text beside the Table of
contents.

My question is, how can I print without viewing the 2 buttons?

The document is a template and I cant place the button in a toolbar.
The document is secure then I cant just use some image in the draw tool bar.
I dont have a custom print button and dont want it, then I cant put my
programmation in it.

I just want to put 2 buttons invisible to printing... please help!

Thanks for all who tried before with good response but not the one I want.
 
J

Jonathan West

Hi Evens

There are two possible approaches.

1. (Recommended approach). Don't put the buttons in the document at all.
Instead, create a custom toolbar and place buttons on that which call your
macros. then you needn't bother hiding anything.

2. If your buttons are members of the Shapes collection of the document,
then your print routine can set the Hidden property of each of the
appropriate shapes to true, then print, then set the property back to False
again.

--
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
 
E

Evens

Hi Jonathan,

Thanks for your response,

But I have to send the template by email. I'm not sure that the custom
toolbar will follow the document! If it can, is it something special to do?

The other solution is correct but I dont have any print button to handle the
printing. How can you create an event to hide the button before printing and
show them right after?

Thanks again
 
J

Jonathan West

Evens said:
Hi Jonathan,

Thanks for your response,

But I have to send the template by email. I'm not sure that the custom
toolbar will follow the document! If it can, is it something special to
do?

Templates can include custom toolbars

Take a look at these articles

What do Templates and Add-ins store?
http://www.word.mvps.org/FAQs/Customization/WhatTemplatesStore.htm

Creating Custom Toolbars for Templates
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=262

The other solution is correct but I dont have any print button to handle
the
printing. How can you create an event to hide the button before printing
and
show them right after?

Create two macros in your template, called FilePrint and FilePrintDefault.
When the template is loaded, these macros will be run instead of the
equivalent built-in commands whenever the print button on the main toolbar
is clicked on the Print item on the file menu is used.


--
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
 
E

Evens

Great! Thanks a lot

Jonathan West said:
Templates can include custom toolbars

Take a look at these articles

What do Templates and Add-ins store?
http://www.word.mvps.org/FAQs/Customization/WhatTemplatesStore.htm

Creating Custom Toolbars for Templates
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=262



Create two macros in your template, called FilePrint and FilePrintDefault.
When the template is loaded, these macros will be run instead of the
equivalent built-in commands whenever the print button on the main toolbar
is clicked on the Print item on the file menu is used.


--
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
 

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