VBA question Picture scaling

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Hello all,
I found out how to place pictures on a powerpoint slide using this VBA-code:


ppApp.ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:=MyPICTUREPATH,
LinkToFile:=False, SaveWithDocument:=True, Left:=100, top:=220,
Width:=100).Select

The problem i encounter is that the picture is scaled to width=100 and
heigth is not scaled.
I would like the picture to scale proportionally to a width of 100 and a
height proportional with the width (so the picture is not distorted).
Can anyone help me?

Thank, Rob
 
I'll try again with the line breaks set better!

Set opic = ActiveWindow.Selection.SlideRange.Shapes.AddPicture _
(FileName:=MyPICTUREPATH, LinkToFile:=False, SaveWithDocument:=True, _
Left:=100, Top:=220)
opic.LockAspectRatio = msoTrue
opic.Width = 100
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
Hello John, thanks for replying.

It gives me error 424 Object required
I must declare the opic as what kind of object?
 
Never mind my other question, ;;;
Your solution works perfect, thanks...
(just i typing mistake...)
 
Back
Top