首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

VBA 刷PPT OLE对象能变形,求解

2012-12-27 
VBA 刷PPT OLE对象会变形,求解VBA 刷PPT OLE对象会变形,求解;还有 我在2003下, auto_open函数为什么不自动

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



[解决办法]
该回复于2011-12-14 09:36:00被版主删除

热点排行