Setting the Vertical Position on an Image

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
 
C

Cindy M.

Hi =?Utf-8?B?QWlsaXNo?=,
For some reason it is ignoring the Vertical Position relative to the
paragraph and leaving it at relative to margin!!
Try setting the Relative positions before specifying the Top and Left
positions.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
A

Ailish

Already did that, any other suggestions.

Cindy M. said:
Hi =?Utf-8?B?QWlsaXNo?=,

Try setting the Relative positions before specifying the Top and Left
positions.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)


This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

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