![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | [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 Specs![]() |
| | #2 (permalink) |
| | 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)? > 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 Specs![]() |
| | #3 (permalink) |
| | 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) |
My System Specs![]() |
![]() |
| 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 | |||