I'm writing some data on word doc from vb6 application. There are many pages.
I want to insert Watermark (it's a big logo) on each page.
Can anyone suggest or pm some good code or links.
Printable View
I'm writing some data on word doc from vb6 application. There are many pages.
I want to insert Watermark (it's a big logo) on each page.
Can anyone suggest or pm some good code or links.
When dealing with this sort of thing, it's easiest to record a macro, take a look at the Word-generated code, then adapt for your particular need.
The recorded macro:
Code:ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddPicture(FileName:="C:\MyPicture.png", _
LinkToFile:=False, SaveWithDocument:=True).Select
Selection.ShapeRange.Name = "WordPictureWatermark26334388"
Selection.ShapeRange.PictureFormat.Brightness = 0.85
Selection.ShapeRange.PictureFormat.Contrast = 0.15
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(2.79)
Selection.ShapeRange.Width = InchesToPoints(6.5)
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
Should I have to use it after completion of all of my pages or I have to run it after/before page.?
Since you're dealing with the header (not a particular page), I wouldn't think it would matter.
Thanx. It works greatly.