Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - [MS Word Macro] VBscript flag image to not print it

Reply
 
Old 03-27-2009   #1 (permalink)
marnick.vos


 
 

[MS Word Macro] VBscript flag image to not print it

Hello group,

A quick sketch on my situation:

I made a template in MS Word 2003 for administrative tasks in an
office. It consists of form text fields.
When the user completes filling in the form, it will be printed on an
official document (insurance type). So I had to place the form text
fields carefully according to the layout of the document. I used a
scan from the document and placed it on the "background" of the
template (order -> send to back) to place the text fields.

When I delete the scanned image, the document looks really empty (just
a small logo and the grey fields). I know there is an option in Word
to disable printing backgrounds (if I would use it as a background),
but this is not an option because the users are not so handy when it
comes to using computers and changing settings.

So a breakdown of my question:
Is there any way to "flag" the image in a macro (AutoExec) using
VBScript so that it should not be printed when the user prints the
finished form (document)?

Thanks!

My System SpecsSystem Spec
Old 03-28-2009   #2 (permalink)
mr_unreliable


 
 

Re: [MS Word Macro] VBscript flag image to not print it

marnick.vos@xxxxxx wrote:
Quote:

> I know there is an option in Word
> to disable printing backgrounds (if I would use it as a background),
> but this is not an option because the users are not so handy when it
> comes to using computers and changing settings.
>
> Is there any way to "flag" the image in a macro (AutoExec) using
> VBScript so that it should not be printed when the user prints the
> finished form (document)?
>
hi Marnick,

I suggest that you do the following in an "AutoOpen" macro.
This assumes that your users have permission to run wd macros.

- Start with an empty AutoOpen macro. Optionally, you may
also wish to include an empty AutoClose macro.

- In your AutoOpen procedure, test whether the document being
opened is your contract document. If so, then set up an event
handler for the "DocumentBeforePrint" event. There is a
discussion in your help file on how to set up an event handler,
entitled: "Using Events with the Application Object". You may
also wish to cancel this event handler in your AutoClose macro.

- If you haven't already, turn on the macro recorder, and
(manually) go through the series of steps needed to disable
printing your document background. Then turn off the recorder.
What you get from the recorder is some vba code that turns off
the background image. Insert this code into the
"DocumentBeforePrint" event handler. You may also wish to
reverse this in your AutoClose macro.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)
My System SpecsSystem Spec
Old 03-30-2009   #3 (permalink)
marnick.vos


 
 

Re: VBscript flag image to not print it

On 28 mrt, 17:04, mr_unreliable <kindlyReplyToNewsgr...@xxxxxx>
wrote:
Quote:

> marnick....@xxxxxx wrote:
Quote:

> > I know there is an option in Word
> > to disable printing backgrounds (if I would use it as a background),
> > but this is not an option because the users are not so handy when it
> > comes to using computers and changing settings.
>
Quote:

> > Is there any way to "flag" the image in a macro (AutoExec) using
> > VBScript so that it should not be printed when the user prints the
> > finished form (document)?
>
> hi Marnick,
>
> I suggest that you do the following in an "AutoOpen" macro.
> This assumes that your users have permission to run wd macros.
>
> - Start with an empty AutoOpen macro. *Optionally, you may
> also wish to include an empty AutoClose macro.
>
> - In your AutoOpen procedure, test whether the document being
> opened is your contract document. *If so, then set up an event
> handler for the "DocumentBeforePrint" event. *There is a
> discussion in your help file on how to set up an event handler,
> entitled: "Using Events with the Application Object". *You may
> also wish to cancel this event handler in your AutoClose macro.
>
> - If you haven't already, turn on the macro recorder, and
> (manually) go through the series of steps needed to disable
> printing your document background. *Then turn off the recorder.
> What you get from the recorder is some vba code that turns off
> the background image. *Insert this code into the
> "DocumentBeforePrint" event handler. *You may also wish to
> reverse this in your AutoClose macro.
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? *WE GOT ANSWERS!!! *..(but, no guarantee
> * * the answers will be applicable to the questions)
Thanks a lot mr_unreliable, your tips were very helpful.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Excel won't print, Word,Powerpoint do print Vista print fax & scan
Access textbox contents to Word via VBScript VB Script
Visual Basic opening when word macro is intiated .NET General
Modify a .doc document with a macro without Word ? VB Script
Word 97 on Windows Vista - Word Unloads On Print Vista print fax & scan


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46