A
Ailish
Hi All
I am trying to write some code that will insert an image and position it at:
Horizontal Position: 2.6 mm to the right of the column
Vertical Position: 0mm below the paragraph
Move with Text = Yes
Lock Anchor = No
Allow Overlap = Yes
Layout in Table Cell = Yes
The code I am using is:
Dim oShape As Shape
With Dialogs(wdDialogInsertPicture)
If .Display Then
Set oShape = ActiveDocument.Shapes.AddPicture(FileName:=.Name,
Anchor:=Selection.Range)
With oShape
.Height = .Height * 277 / PointsToMillimeters(.Width)
.Width = MillimetersToPoints(38.66)
.Left = MillimetersToPoints(-21.8)
.Top = MillimetersToPoints(0)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
.RelativeVerticalPosition = wdRelativeVerticalPositionParagrah
.LockAnchor = False
.LayoutInCell = True
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapBoth
.WrapFormat.DistanceTop = InchesToPoints(0)
.WrapFormat.DistanceBottom = InchesToPoints(0)
.WrapFormat.DistanceLeft = InchesToPoints(0.1)
.WrapFormat.DistanceRight = InchesToPoints(0.1)
.WrapFormat.Type = wdWrapSquare
End With
End If
End With
Set oShape = Nothing
For some reason it is ignoring the Vertical Position relative to the
paragraph and leaving it at relative to margin!!
Help, it is driving me mad.
Thanks
Ailish
I am trying to write some code that will insert an image and position it at:
Horizontal Position: 2.6 mm to the right of the column
Vertical Position: 0mm below the paragraph
Move with Text = Yes
Lock Anchor = No
Allow Overlap = Yes
Layout in Table Cell = Yes
The code I am using is:
Dim oShape As Shape
With Dialogs(wdDialogInsertPicture)
If .Display Then
Set oShape = ActiveDocument.Shapes.AddPicture(FileName:=.Name,
Anchor:=Selection.Range)
With oShape
.Height = .Height * 277 / PointsToMillimeters(.Width)
.Width = MillimetersToPoints(38.66)
.Left = MillimetersToPoints(-21.8)
.Top = MillimetersToPoints(0)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
.RelativeVerticalPosition = wdRelativeVerticalPositionParagrah
.LockAnchor = False
.LayoutInCell = True
.WrapFormat.AllowOverlap = True
.WrapFormat.Side = wdWrapBoth
.WrapFormat.DistanceTop = InchesToPoints(0)
.WrapFormat.DistanceBottom = InchesToPoints(0)
.WrapFormat.DistanceLeft = InchesToPoints(0.1)
.WrapFormat.DistanceRight = InchesToPoints(0.1)
.WrapFormat.Type = wdWrapSquare
End With
End If
End With
Set oShape = Nothing
For some reason it is ignoring the Vertical Position relative to the
paragraph and leaving it at relative to margin!!
Help, it is driving me mad.
Thanks
Ailish