标题:VBA 刷PPT OLE对象会变形,求解
只看楼主
andy20050125
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-12-6
 问题点数:0 回复次数:1 
VBA 刷PPT OLE对象会变形,求解
VBA 刷PPT OLE对象会变形,求解;
还有 我在2003下, auto_open函数为什么不自动执行,要手动去调用;

PPT 为
http://hi.
下载到本地修改为 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


搜索更多相关主题的帖子: 变形 color 
2011-12-13 21:58
andy20050125
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2011-12-6
得分:0 
斑竹呢,出来晒晒吧
2011-12-13 22:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-357690-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.103978 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved