I'm interested in having certain pieces of text highlighted or shaded on the
screen but not when printed. What's the easiest way to accomplish this?

Re: Shading/Highlighting by Jean-Guy

Jean-Guy
Thu Sep 07 14:28:06 CDT 2006

klav was telling us:
klav nous racontait que :

> I'm interested in having certain pieces of text highlighted or shaded
> on the screen but not when printed. What's the easiest way to
> accomplish this?

You could intercept the Print command, remove the highlight, print, then
undo:

'_______________________________________
Sub FilePrint()

ActiveDocument.Range.HighlightColorIndex = wdNoHighlight

Dialogs(wdDialogFilePrint).Show

ActiveDocument.Undo

End Sub
'_______________________________________

'_______________________________________
Sub FilePrintDefault()

With ActiveDocument
.Range.HighlightColorIndex = wdNoHighlight
.PrintOut
.Undo
End With

End Sub
'_______________________________________

The subs must be named as they are here. Then, whenever a user does CTRL-P,
File > Print or clicks on the Print button on the standard toolbar, the code
will run instead.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org



Re: Shading/Highlighting by Klaus

Klaus
Fri Sep 08 00:27:18 CDT 2006

"klav" wrote:
> I'm interested in having certain pieces of text highlighted
> or shaded on the screen but not when printed. What's the
> easiest way to accomplish this?

Not terribly easy, but maybe a clean solution:
Have two templates, one for screen and one for printing.

You could have character styles that are highlighted or shaded for the
screen version, and that have no additional formatting for printing.

The fonts could also be optimized for screen in one case, for printing in
the other.

To switch between them, you'd switch the attached template (Tools >
Templates and Add-Ins), and update the styles.
Or use a macro.

I do something like that sometimes for web-/printer-versions of a doc.

Regards,
Klaus