VBA 刷PPT OLE对象会变形,求解
VBA 刷PPT OLE对象会变形,求解;
还有 我在2003下, auto_open函数为什么不自动执行,要手动去调用;
PPT 为
http://hi.csdn.net/attachment/201112/13/0_1323783655LPau.gif
下载到本地修改为 report.ppt
Sub auto_open()
Dim slideCount As Integer
Dim shapeCount As Integer
Dim shapeType As Integer
Dim shapeWidth As Integer
Dim shapeHeight As Integer
For slideCount = 1 To ActivePresentation.Slides.Count
For shapeCount = 1 To ActivePresentation.Slides(slideCount).Shapes.Count
shapeType = ActivePresentation.Slides(slideCount).Shapes(shapeCount).Type
'autoShape:1 object:7 picture:13
'If shapeType = 7 Then
If shapeType = msoEmbeddedOLEObject Then
'MsgBox ActivePresentation.Slides(slideCount).Shapes(shapeCount).Name
'MsgBox ActivePresentation.Slides(slideCount).Shapes(shapeCount).Type
Set obj = ActivePresentation.Slides(slideCount).Shapes(shapeCount).OLEFormat
On Error Resume Next
shapeWidth = ActivePresentation.Slides(slideCount).Shapes(shapeCount).Width
shapeHeight = ActivePresentation.Slides(slideCount).Shapes(shapeCount).Height
ActivePresentation.Slides(slideCount).Shapes(shapeCount).OLEFormat.Object.Refresh
ActivePresentation.Slides(slideCount).Shapes(shapeCount).Width = shapeWidth
ActivePresentation.Slides(slideCount).Shapes(shapeCount).Height = shapeHeight
End If
Next
Next
ActivePresentation.Save
End Sub