A
aehan
Hello
I contacted Discussion Groups a few weeks ago because I wanted to scale
imported pictures to 50%, 25%, 75% etc of their size using code, and Jean-Guy
Marcil gave me some code that I really appreciated. However, I have hit a
snag. The pictures are logos, and are pictures and text, when Word imports
them it fits them across the margins, changing the size of the logo which
will now appear as, eg 55% of the original. When I wrote the routine for
scaling the macro I took this into account, eg 50% was half of 55% and so on.
However, to my horror I now see that Word uses the existing margins and
orientation of the current document, so what was 55% in portrait changes when
you import it as landscape.
Help!!! Does anyone have an idea of how I can write the code to look at the
proprotions of the graphic as displayed in the height and width boxes of the
Size properties in the Format dialogue box? Hope I am explaining this
correctly.
The code as provided by Jean-Guy at present is:
With Selection
Select Case .Type
Case 7 'Inline shape
.InlineShapes(1).ScaleHeight = 50
.InlineShapes(1).ScaleWidth = 50
Case 8 'Floating picture
.ShapeRange(1).ScaleHeight 0.5, True
.ShapeRange(1).ScaleWidth 0.5, True
Case Else
MsgBox "The current selection is not a picture." _
& vbCrLf & "Make sure you select only the picture itself.",
_
vbExclamation, "Error"
End Select
End With
Thanks for any help you can give.
Aehan
I contacted Discussion Groups a few weeks ago because I wanted to scale
imported pictures to 50%, 25%, 75% etc of their size using code, and Jean-Guy
Marcil gave me some code that I really appreciated. However, I have hit a
snag. The pictures are logos, and are pictures and text, when Word imports
them it fits them across the margins, changing the size of the logo which
will now appear as, eg 55% of the original. When I wrote the routine for
scaling the macro I took this into account, eg 50% was half of 55% and so on.
However, to my horror I now see that Word uses the existing margins and
orientation of the current document, so what was 55% in portrait changes when
you import it as landscape.
Help!!! Does anyone have an idea of how I can write the code to look at the
proprotions of the graphic as displayed in the height and width boxes of the
Size properties in the Format dialogue box? Hope I am explaining this
correctly.
The code as provided by Jean-Guy at present is:
With Selection
Select Case .Type
Case 7 'Inline shape
.InlineShapes(1).ScaleHeight = 50
.InlineShapes(1).ScaleWidth = 50
Case 8 'Floating picture
.ShapeRange(1).ScaleHeight 0.5, True
.ShapeRange(1).ScaleWidth 0.5, True
Case Else
MsgBox "The current selection is not a picture." _
& vbCrLf & "Make sure you select only the picture itself.",
_
vbExclamation, "Error"
End Select
End With
Thanks for any help you can give.
Aehan