Using a Watermark with a macro

K

Keith

I am trying to put a watermark in a document using a Macro. I keep getting the error: Runtime error '5894': Command only available in print layout view. I am using Word 2000. Below is a copy of the code I am using. If someone could help, that would be great!

Thanks,

Keith

ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddPicture(FileName:= _
"C:\Documents and Settings\ksylvester\Desktop\MMS_BW.bmp", _
LinkToFile:=False, SaveWithDocument:=True).Select
Selection.ShapeRange.Name = "WordPictureWatermark1"
Selection.ShapeRange.PictureFormat.Brightness = 0.85
Selection.ShapeRange.PictureFormat.Contrast = 0.15
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(2.6)
Selection.ShapeRange.Width = InchesToPoints(5.99)
Selection.ShapeRange.WrapFormat.AllowOverlap = True
Selection.ShapeRange.WrapFormat.Side = wdWrapNone
Selection.ShapeRange.WrapFormat.Type = 3
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeVerticalPositionMargin
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionMargin
Selection.ShapeRange.Left = wdShapeCenter
Selection.ShapeRange.Top = wdShapeCenter
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
 
J

Jezebel

Rewrite the macro to avoid working with the Selection object and to
eliminate all references to Windows and Panes. You can refer to the document
headers using code like:

ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary)

Modify as necessary if you have different headers for each section or
different first or different even/odd page headers.






Keith said:
I am trying to put a watermark in a document using a Macro. I keep
getting the error: Runtime error '5894': Command only available in print
layout view. I am using Word 2000. Below is a copy of the code I am using.
If someone could help, that would be great!
 

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