| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 543 人关注过本帖
标题: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
快速回复:VBA 刷PPT OLE对象会变形,求解
数据加载中...
 
   



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

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