PC Review


Reply
Thread Tools Rate Thread

Change text when printed

 
 
=?Utf-8?B?Q2FybCBBLg==?=
Guest
Posts: n/a
 
      18th Sep 2007
I have a footer containing the line "This is a controlled document."

This is what I want to appear when the document is viewed. However, when
the document is printed I want the line to read:
"This is an uncontrolled copy of a controlled document."

This is fairly easily accomplished using Adobe Acrobat (by inserting a field
on top of the original text that contains the "print" text, and set the field
to print only. Is there a way to accomplish the same thing from within Word
(2003)?
 
Reply With Quote
 
 
 
 
Stefan Blom
Guest
Posts: n/a
 
      20th Sep 2007
You can do this by intercepting the FilePrint and FilePrintDefault commands
with macros. The task will be relatively easy if you are dealing with a
single-section document with one footer, in which case something like this
should work:

Sub FilePrintDefault()
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary) _
.Range.Text = "This is an uncontrolled copy of a controlled document."
ActiveDocument.PrintOut

End Sub

Sub FilePrint()
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary) _
.Range.Text = "This is an uncontrolled copy of a controlled document."
Application.Dialogs(wdDialogFilePrint).Show

End Sub

Note that with these simple macros you will have to close the documents
without saving. If not, the new footer text will be saved with the document.

Add the macros in the template attached to the document. If you need
assistance, see http://www.gmayor.com/installing_macro.htm.

For more advanced macros, ask in a programming newsgroup, such as
microsoft.public.word.vba.general.

See also http://word.mvps.org/faqs/macrosvba/...tSavePrint.htm.

--
Stefan Blom
Microsoft Word MVP


"Carl A." wrote in message
news:2E7382BE-3A30-487D-A4DA-(E-Mail Removed)...
>I have a footer containing the line "This is a controlled document."
>
> This is what I want to appear when the document is viewed. However, when
> the document is printed I want the line to read:
> "This is an uncontrolled copy of a controlled document."
>
> This is fairly easily accomplished using Adobe Acrobat (by inserting a
> field
> on top of the original text that contains the "print" text, and set the
> field
> to print only. Is there a way to accomplish the same thing from within
> Word
> (2003)?


















 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Text Box in Page Header based on Sub Report Being Printed on Page JeffTO Microsoft Access Reports 0 2nd Mar 2011 11:16 PM
printed emails are not WSIWG. Code is printed vs. the actual text Nik Windows XP Print / Fax 1 17th May 2009 02:23 AM
Why is screen text actually larger than printed text? =?Utf-8?B?bW9udGF1a2xpdGU=?= Microsoft Word Document Management 1 7th Nov 2006 06:05 PM
text runs off the page when printed even when I change th margins =?Utf-8?B?U3V6eno=?= Microsoft Word New Users 1 11th Aug 2006 03:24 PM
text boxes,grouped & formated tight,losing text when printed Knopf Microsoft Windows 2000 0 1st Aug 2003 04:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:08 AM.