G
George Lima
The following code does go to each page but adds all the pictures to
the first page. I can do this process manually but not through a
macro.
Any help would be appreciated.
Dim sFilename As String
For x = 1 To ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
sFilename = "C:\Pictures\Page" + chr$(x) + ".WMF"
ActiveDocument.Bookmarks("\Page").Range.Select
Selection.GoTo What:=wdGoToPage, which:=wdGoToAbsolute, Count:=x
ActiveDocument.Shapes.AddPicture(FileName:= _
sFilename , LinkToFile:=False, SaveWithDocument:=True).Select
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 100#
Selection.ShapeRange.Width = 100#
Selection.ShapeRange.PictureFormat.Brightness = 0.85
Selection.ShapeRange.PictureFormat.Contrast = 0.15
Selection.ShapeRange.PictureFormat.CropLeft = 0#
Selection.ShapeRange.PictureFormat.CropRight = 0#
Selection.ShapeRange.PictureFormat.CropTop = 0#
Selection.ShapeRange.PictureFormat.CropBottom = 0#
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionPage
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
Selection.ShapeRange.Left = InchesToPoints(0)
Selection.ShapeRange.Top = InchesToPoints(0)
Selection.ShapeRange.LockAnchor = False
Selection.ShapeRange.WrapFormat.AllowOverlap = True
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.Type = wdWrapNone
Selection.ShapeRange.ZOrder msoSendBehindText
Next
the first page. I can do this process manually but not through a
macro.
Any help would be appreciated.
Dim sFilename As String
For x = 1 To ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
sFilename = "C:\Pictures\Page" + chr$(x) + ".WMF"
ActiveDocument.Bookmarks("\Page").Range.Select
Selection.GoTo What:=wdGoToPage, which:=wdGoToAbsolute, Count:=x
ActiveDocument.Shapes.AddPicture(FileName:= _
sFilename , LinkToFile:=False, SaveWithDocument:=True).Select
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoFalse
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 100#
Selection.ShapeRange.Width = 100#
Selection.ShapeRange.PictureFormat.Brightness = 0.85
Selection.ShapeRange.PictureFormat.Contrast = 0.15
Selection.ShapeRange.PictureFormat.CropLeft = 0#
Selection.ShapeRange.PictureFormat.CropRight = 0#
Selection.ShapeRange.PictureFormat.CropTop = 0#
Selection.ShapeRange.PictureFormat.CropBottom = 0#
Selection.ShapeRange.RelativeHorizontalPosition = _
wdRelativeHorizontalPositionPage
Selection.ShapeRange.RelativeVerticalPosition = _
wdRelativeVerticalPositionPage
Selection.ShapeRange.Left = InchesToPoints(0)
Selection.ShapeRange.Top = InchesToPoints(0)
Selection.ShapeRange.LockAnchor = False
Selection.ShapeRange.WrapFormat.AllowOverlap = True
Selection.ShapeRange.WrapFormat.Side = wdWrapBoth
Selection.ShapeRange.WrapFormat.Type = wdWrapNone
Selection.ShapeRange.ZOrder msoSendBehindText
Next