Macro for that stops a picture from printing

Macro for that stops a picture from printing

Post by TWFydGluIE » Wed, 10 Oct 2007 22:21:02


Hi,

I'm using microsoft word 2003 and I want to set a JPEG in the header and
footer background to show the other people where to type but do not want this
to JPEG to print. I just want it to be in the document as a reference image
as it is to be pre-printed.

I had a reply that a macro is available to be able to do this, if so can
someone forward me in the right direction?

Thanks

Martin
 
 
 

Macro for that stops a picture from printing

Post by Jean-Guy M » Wed, 10 Oct 2007 23:01:16

Martin H was telling us:
Martin H nous racontait que :


Something like this to get you going:

'_______________________________________
Dim rgeHeader As Range
Dim rgeFooter As Range

Set rgeHeader =
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
Set rgeFooter =
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range

With rgeHeader
.ShapeRange.Delete
End With

With rgeFooter
.ShapeRange.Delete
End With

Application.Dialogs(wdDialogFilePrint).Show

ActiveDocument.Undo 2
'_______________________________________

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
XXXX@XXXXX.COM
Word MVP site: http://www.yqcomputer.com/