Shading/Highlighting

K

klav

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

Jean-Guy Marcil

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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
K

Klaus Linke

klav said:
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
 

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