K
Kerry
Hi
I want a procedure in my template which simplifies the
entering of pictures into a table, inserting them at the
correct size. The procedure is in place but I cannot
understand the meaurement units being used and cannot
find any info in help about it - I have to have a set
picture size but I can't seem to change the measurement
unit.
Please find the code below - the size I want for the
photos is 6.5cm height x 5.5cm width but the code only
seems to want to work on numbers in the hundreds, does
anyone have any ideas what units are being used and how I
can convert them to centimetres in the code or just how
to work it out manually to enter the correct number.
Many Many thanks
InsertPhoto:
Dim Myrange As Range
With Options
.PictureEditor = "Microsoft Word"
.PictureWrapType = wdWrapMergeFront
.MeasurementUnit = wdCentimeters
'measurement unit doesn't seem to make any diff
End With
If Selection.Information(wdWithInTable) Then
With Dialogs(wdDialogInsertPicture)
If .Show Then
Set Myrange = Selection.Cells(1).Range
If Myrange.InlineShapes.Count > 0 Then
With Myrange.InlineShapes(1)
.LockAspectRatio = msoTrue
.Height = 6.5 '138.5
.Width = 5.5 '147.4
End With
Else
With Myrange.ShapeRange
.LockAspectRatio = msoTrue
.Width = 5.5 '147.4
.Left = wdShapeCenter
.WrapFormat.Type = wdWrapThrough
' .WrapFormat.Side = wdWrapBoth
.LockAnchor = False
.IncrementLeft 1#
.IncrementTop 20#
End With
End If
End If
End With
End If
I want a procedure in my template which simplifies the
entering of pictures into a table, inserting them at the
correct size. The procedure is in place but I cannot
understand the meaurement units being used and cannot
find any info in help about it - I have to have a set
picture size but I can't seem to change the measurement
unit.
Please find the code below - the size I want for the
photos is 6.5cm height x 5.5cm width but the code only
seems to want to work on numbers in the hundreds, does
anyone have any ideas what units are being used and how I
can convert them to centimetres in the code or just how
to work it out manually to enter the correct number.
Many Many thanks
InsertPhoto:
Dim Myrange As Range
With Options
.PictureEditor = "Microsoft Word"
.PictureWrapType = wdWrapMergeFront
.MeasurementUnit = wdCentimeters
'measurement unit doesn't seem to make any diff
End With
If Selection.Information(wdWithInTable) Then
With Dialogs(wdDialogInsertPicture)
If .Show Then
Set Myrange = Selection.Cells(1).Range
If Myrange.InlineShapes.Count > 0 Then
With Myrange.InlineShapes(1)
.LockAspectRatio = msoTrue
.Height = 6.5 '138.5
.Width = 5.5 '147.4
End With
Else
With Myrange.ShapeRange
.LockAspectRatio = msoTrue
.Width = 5.5 '147.4
.Left = wdShapeCenter
.WrapFormat.Type = wdWrapThrough
' .WrapFormat.Side = wdWrapBoth
.LockAnchor = False
.IncrementLeft 1#
.IncrementTop 20#
End With
End If
End If
End With
End If