R
rv.aleixo.alves
Hello, everyone!
I'm trying to make a macro to format pictures automatically after I insert them in a table in a word document.
I want to resize the pictures to 60% (Height and Width) and crop the margins (0.6 centimetres from top, left and right and 0.4 from bottom). Then I want the picture, to be inside the table, to have a text wrapping = Top andbottom, send to backwards, and then I want to change its layout to: horizontal alignment center relative to column; vertical absolute position, 0 cm to paragraph.
What I've accomplished so far (reading this group) was this macro code:
Sub FDiagCoord()
On Error GoTo ErrorHandler
Dim oILS As InlineShape
Set oILS = Selection.InlineShapes(1)
With oILS
.PictureFormat.CropLeft = CentimetersToPoints(0.6)
.PictureFormat.CropTop = CentimetersToPoints(0.6)
.PictureFormat.CropRight = CentimetersToPoints(0.6)
.PictureFormat.CropBottom = CentimetersToPoints(0.4)
End With
With oILS
.LockAspectRatio = True
.ScaleHeight = 60
End With
Set oShp = Selection.InlineShapes(1).ConvertToShape
oShp.WrapFormat.Type = wdWrapTopBottom
oShp.ZOrderCmd = msoSendBackward
oShp.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
oShp.wdRelativeHorizontalPositionColumn = wdCenter
Exit Sub
ErrorHandler:
MsgBox "No picture selected."
End Sub
It doesn't work completely, something is missing... And I'm stuck for quieta while now...
Can somebody help me?
Thank you very much,
Ricardo
I'm trying to make a macro to format pictures automatically after I insert them in a table in a word document.
I want to resize the pictures to 60% (Height and Width) and crop the margins (0.6 centimetres from top, left and right and 0.4 from bottom). Then I want the picture, to be inside the table, to have a text wrapping = Top andbottom, send to backwards, and then I want to change its layout to: horizontal alignment center relative to column; vertical absolute position, 0 cm to paragraph.
What I've accomplished so far (reading this group) was this macro code:
Sub FDiagCoord()
On Error GoTo ErrorHandler
Dim oILS As InlineShape
Set oILS = Selection.InlineShapes(1)
With oILS
.PictureFormat.CropLeft = CentimetersToPoints(0.6)
.PictureFormat.CropTop = CentimetersToPoints(0.6)
.PictureFormat.CropRight = CentimetersToPoints(0.6)
.PictureFormat.CropBottom = CentimetersToPoints(0.4)
End With
With oILS
.LockAspectRatio = True
.ScaleHeight = 60
End With
Set oShp = Selection.InlineShapes(1).ConvertToShape
oShp.WrapFormat.Type = wdWrapTopBottom
oShp.ZOrderCmd = msoSendBackward
oShp.RelativeHorizontalPosition = wdRelativeHorizontalPositionColumn
oShp.wdRelativeHorizontalPositionColumn = wdCenter
Exit Sub
ErrorHandler:
MsgBox "No picture selected."
End Sub
It doesn't work completely, something is missing... And I'm stuck for quieta while now...
Can somebody help me?
Thank you very much,
Ricardo