Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 3 Jul 2008 06:37:34 -0700 (PDT),    group: microsoft.public.word.vba.general        back       


How can I to scale down or to scale up proportionally dimension of pictures?   
Hello. The document has a lot of the formulas (as pictures). The
formulas has different dimensions: very big, normal and small. I need
to reduce they to some equal dimension (to reduce to common
denominator). I have code but the result of work not suit for me: e.g.
the text into the big formulas converges and other problems. Here the
code:
Sub changeImages()
Dim iShape As InlineShape
For Each iShape In ActiveDocument.InlineShapes
  iShape.Height = 17
  iShape.Width = 138
Next iShape
End Sub
How to scale down or to scale up proportionally dimensions of the all
formulas (pictures)?
Thank you.
date: Thu, 3 Jul 2008 06:37:34 -0700 (PDT)   author:   avkokin

RE: How can I to scale down or to scale up proportionally dimension of   
"avkokin" wrote:

> Hello. The document has a lot of the formulas (as pictures). The
> formulas has different dimensions: very big, normal and small. I need
> to reduce they to some equal dimension (to reduce to common
> denominator). I have code but the result of work not suit for me: e.g.
> the text into the big formulas converges and other problems. Here the

If you change the size of those equations so that they all have the same 
size (Height and Width), you will have distortion problems and you cannot 
avoid that.

If you want, you can reduce all inline shapes by a certain ratio based on 
the shape width, then you would use something like this:

Sub changeImages()

Dim iShape As InlineShape
Const sngWidth As Single = 150

For Each iShape In ActiveDocument.InlineShapes
   With iShape
      .ScaleHeight = (.Width / sngWidth) * 100
      .ScaleWidth = (.Width / sngWidth) * 100
   End With
Next iShape

End Sub


Alternatively, if you want to reduce all shapes by an absolute  percentage, 
let's say, 50%, try:

Sub changeImages()

Dim iShape As InlineShape

For Each iShape In ActiveDocument.InlineShapes
   With iShape
      .ScaleHeight = 50
      .ScaleWidth = 50
   End With
Next iShape

End Sub

If you want to set them all to the same size while trying to avoid 
distortion, try this:


Sub changeImages()

Dim iShape As InlineShape
Const sngWidth As Single = 72 '72 points = 1 inche

For Each iShape In ActiveDocument.InlineShapes
    With iShape
        .Height = .Height * (sngWidth / .Width)
        .Width = sngWidth
    End With
Next iShape

End Sub
date: Thu, 3 Jul 2008 08:20:03 -0700   author:   Jean-Guy Marcil

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us