word 2003 vba
Hey fellow programmers
I am accessing word 2003 documents through vba. I wanted to programmatically insert / delete watermarks in an already existing document and align the text accordingly; here is the code I got from a macro. I dint get some function details from here could you people help me out
---------------------------Macro code-------------------------
ActiveDocument.Sections(1).Range.Select
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.Shapes.AddPicture(FileName: = _
"D:\Documents and Settings\Administrator\Desktop\images\images1.jpg" , _
LinkToFile:=False, SaveWithDocument:=True).Select
Selection.ShapeRange.Name = "WordPictureWatermark1"
Selection.ShapeRange.PictureFormat.Brightness = 0.5
Selection.ShapeRange.PictureFormat.Contrast = 0.5
Selection.ShapeRange.LockAspectRatio = True
Selection.ShapeRange.Height = InchesToPoints(9.86) <---- how in the world did word know the size of the picture in inches
Selection.ShapeRange.Width = InchesToPoints(7.71)
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
-----------------------------end------------------------------
Guys also suggest me how to align the text which is already existing in the document to the center with the watermark
|