T
tiger
Hi,
I have the following VBA code for PowerPoint.....and I this error message
"object variable or with block varible not set".
Sub InsertAndSizePicture()
Dim oPicture as Shape
Dim FullPath as String
' Set this to the full path to picture.
FullPath ="C:\My Documents\Pictures\MyPhoto.JPG"
' Insert the picture at an arbitrary size;
' PowerPoint requires you to supply *some* height and width for the picture
Set oPicture = ActiveWindow.Selection.Shapes.AddPicture (Filename:=FullPath,
_
LinkToFile:=msoFalse, _
SaveWithDocument:=msoFalse, _
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
End Sub
I have the following VBA code for PowerPoint.....and I this error message
"object variable or with block varible not set".
Sub InsertAndSizePicture()
Dim oPicture as Shape
Dim FullPath as String
' Set this to the full path to picture.
FullPath ="C:\My Documents\Pictures\MyPhoto.JPG"
' Insert the picture at an arbitrary size;
' PowerPoint requires you to supply *some* height and width for the picture
Set oPicture = ActiveWindow.Selection.Shapes.AddPicture (Filename:=FullPath,
_
LinkToFile:=msoFalse, _
SaveWithDocument:=msoFalse, _
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
End Sub