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 ShapeDim 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 pictureSet
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" slzeWith
oPicture .Scaleheight 1, msoTrue .Scalewidth 1, msoTrueEnd
with Set oPicture = NothingEnd SubThanks
Tiger
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 ShapeDim 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 pictureSet
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" slzeWith
oPicture .Scaleheight 1, msoTrue .Scalewidth 1, msoTrueEnd
with Set oPicture = NothingEnd SubThanks
Tiger