J
Jim Machia
I have user's who add a SnapshotFile (MS Access Export) to
a new slide and they crop and scale the shape to fit the
slide. Before cropping the slide they Zoom and Fit the
file in the OLE Object. I tried automation the SendKeys to
Zoom And Fit but it didn't work. I know mouse clicking
works but I wasn't sure how to handle mouse positioning
over the slide. Is there any other way to have OLE object
on file zoomed and fit ?
Part 1: AddOLEObject from an Open File
==============================
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject
(Left:=0#, Top:=0#, Width:=720#, Height:=540#,
FileName:=fstr, Link:=msoFalse).Select
If ActiveWindow.Selection.ShapeRange.OLEFormat.ProgID
<> "SnapshotFile" Then Exit Sub
ActiveWindow.Selection.SlideRange.Shapes(1).Select
Part 2: Zoom And Fit
============
SendKeys "{ENTER}", True
SendKeys "+{F10}", True
SendKeys "{DOWN}", True
SendKeys "{RIGHT}", True
SendKeys "{UP}", True
SendKeys "{UP}", True
SendKeys "{ENTER}", True
ActiveWindow.Selection.Unselect
Part 3: Crop And Resize
===============
ActiveWindow.Selection.SlideRange.Shapes(1).Select
ActiveWindow.Selection.ShapeRange.PictureFormat.CropLeft =
24.32
ActiveWindow.Selection.ShapeRange.PictureFormat.CropRight
= 24.32
ActiveWindow.Selection.ShapeRange.PictureFormat.CropBottom
= 14.58
ActiveWindow.Selection.ShapeRange.PictureFormat.CropTop =
14.58
With ActiveWindow.Selection.ShapeRange
.IncrementLeft -30#
.IncrementTop -18#
End With
With ActiveWindow.Selection.ShapeRange
.ScaleWidth 1.07, msoFalse, msoScaleFromTopLeft
.ScaleHeight 1.07, msoFalse, msoScaleFromTopLeft
End With
ActiveWindow.Selection.ShapeRange.ScaleWidth 1.02,
msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.Unselect
a new slide and they crop and scale the shape to fit the
slide. Before cropping the slide they Zoom and Fit the
file in the OLE Object. I tried automation the SendKeys to
Zoom And Fit but it didn't work. I know mouse clicking
works but I wasn't sure how to handle mouse positioning
over the slide. Is there any other way to have OLE object
on file zoomed and fit ?
Part 1: AddOLEObject from an Open File
==============================
ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject
(Left:=0#, Top:=0#, Width:=720#, Height:=540#,
FileName:=fstr, Link:=msoFalse).Select
If ActiveWindow.Selection.ShapeRange.OLEFormat.ProgID
<> "SnapshotFile" Then Exit Sub
ActiveWindow.Selection.SlideRange.Shapes(1).Select
Part 2: Zoom And Fit
============
SendKeys "{ENTER}", True
SendKeys "+{F10}", True
SendKeys "{DOWN}", True
SendKeys "{RIGHT}", True
SendKeys "{UP}", True
SendKeys "{UP}", True
SendKeys "{ENTER}", True
ActiveWindow.Selection.Unselect
Part 3: Crop And Resize
===============
ActiveWindow.Selection.SlideRange.Shapes(1).Select
ActiveWindow.Selection.ShapeRange.PictureFormat.CropLeft =
24.32
ActiveWindow.Selection.ShapeRange.PictureFormat.CropRight
= 24.32
ActiveWindow.Selection.ShapeRange.PictureFormat.CropBottom
= 14.58
ActiveWindow.Selection.ShapeRange.PictureFormat.CropTop =
14.58
With ActiveWindow.Selection.ShapeRange
.IncrementLeft -30#
.IncrementTop -18#
End With
With ActiveWindow.Selection.ShapeRange
.ScaleWidth 1.07, msoFalse, msoScaleFromTopLeft
.ScaleHeight 1.07, msoFalse, msoScaleFromTopLeft
End With
ActiveWindow.Selection.ShapeRange.ScaleWidth 1.02,
msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.Unselect