TPE
![]() |
![]() |
![]() |
|
|
Tavvafi@gmail.com |
|||
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
Sub InsertAndSizePicture()
Dim oPicture As Shape
Dim FullPath As String
Dim oSl As Slide
' Set this to the full path to picture.
FullPath = "C:\My Documents\Pictures\MyPhoto.JPG"
Set oSl = ActiveWindow.Selection.SlideRange(1)
' Insert the picture at an arbitrary size;
' PowerPoint requires you to supply *some* height and width for the picture
Set oPicture = oSl.Shapes.AddPicture(FileName:=FullPath, _
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, _
Left:=0, Top:=0, _
width:=100, height:=100)
' Rescale the picture to its "natural" slze
With oPicture
.Scaleheight 1, msoTrue
.Scalewidth 1, msoTrue
End With
Set oPicture = Nothing
Set oSl = Nothing
End Sub



































