ppt使用vba

1.在PPT中插入水印
2. 水印中的标号是有顺序的,egC001,C002,C003
3. 批量导出pdf

Sub 插入()
Dim filename As String
Dim file_add As String
Dim file_suffix As String
Dim index_name As String


file_path = "C:\Users\mikowoo\Desktop\001\result\"
file_suffix = ".pdf"
For i = 1 To 111
    If i >= 1 And i <= 9 Then
        index_name = "C00" & i
        ActivePresentation.Designs(1).SlideMaster.Shapes("文本框 2").TextFrame.TextRange.Text = index_name
        ActivePresentation.Designs(1).SlideMaster.Shapes("文本框 4").TextFrame.TextRange.Text = index_name
        filename = file_add & "销售顾问的一天" + index_name + file_suffix
        ActivePresentation.SaveAs filename, ppSaveAsPDF
        'Debug.Print filename
    Else
        If i >= 10 And i <= 99 Then
            index_name = "C0" & i
            ActivePresentation.Designs(1).SlideMaster.Shapes("文本框 2").TextFrame.TextRange.Text = index_name
            ActivePresentation.Designs(1).SlideMaster.Shapes("文本框 4").TextFrame.TextRange.Text = index_name
            filename = file_add & "销售顾问的一天" + index_name + file_suffix
            ActivePresentation.SaveAs filename, ppSaveAsPDF
            'Debug.Print filename
        Else
            index_name = "C" & i
            ActivePresentation.Designs(1).SlideMaster.Shapes("文本框 2").TextFrame.TextRange.Text = index_name
            ActivePresentation.Designs(1).SlideMaster.Shapes("文本框 4").TextFrame.TextRange.Text = index_name
            filename = file_add & "销售顾问的一天" + index_name + file_suffix
            ActivePresentation.SaveAs filename, ppSaveAsPDF
            'Debug.Print filename
        End If
    End If
Next i
End Sub

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
pptvba的属性,类,方法 1.Application对象 该对象代表PowerPoint应用程序,通过该对象可访问PowerPoint中的其他所有对象。 (1)Active属性:返回指定窗格是否被激活。 (2)ActivePresentation属性:返回Presentation对象,代表活动窗口中打开的演示文稿。 (3)ActiveWindow属性:返回DocumentWindow对象,代表当前文档窗口。 (4)Presentations属性:返回Presentations集合,代表所有打开的演示文稿。 (5)SlideShowWindows属性:返回 SlideShowWindows集合,代表所有打开的幻灯片放映窗口。 (6)Quit方法:用于退出PowerPoint程序。 2.DocumentWindow对象 该对象代表文档窗口。使用“Windows(index) ”语法可返回DocumentWindow对象。 (1)ActivePane属性:返回Pane对象,代表文档窗口中的活动窗格。 (2)Panes属性:返回Panes集合,代表文档窗口中的所有窗格。 (3)ViewType属性:返回指定的文档窗口内的视图类型。[NextPage] 3.Presentation对象 该对象代表演示文稿,通过“Presentations(index)”语法可返回Presentation对象。 (1)BuiltInDocumentProperties属性:返回DocumentProperties集合,代表演示文稿的所有文档属性。 (2)ColorSchemes属性:返回ColorSchemes 集合,代表演示文稿的配色方案。 (3)PageSetup属性:返回PageSetup对象,用于控制演示文稿的幻灯片页面设置属性。 (4)SlideMaster属性:返回幻灯片母版对象。 (5)SlideShowSettings属性:返回SlideShowSettings对象,代表演示文稿的幻灯片放映设置。 (6)SlideShowWindow属性:返回幻灯片放映窗口对象。 (7)AddTitleMaster方法:为演示文稿添加标题母版。 (8)ApplyTemplate方法:对演示文稿应用设计模板。 4.SlideShowWindow对象 该对象代表幻灯片放映窗口。 IsFullScreen属性:用于设置是否全屏显示幻灯片放映窗口。[NextPage] 5.Master对象 该对象代表幻灯片母版、标题母版、讲义母版或备注母版。 TextStyles属性:为幻灯片母版返回TextStyles 集合,代表标题文本、正文文本和默认文本。 6.Slide对象 该对象代表幻灯片。 (1)SlideID属性:返回幻灯片的唯一标识符。 (2)SlideIndex属性:返回幻灯片在Slides集合中的索引号。 7.SlideShowView对象 该对象代表幻灯片放映窗口中的视图。 (1)AcceleratorsEnabled属性:用于设置是否允许在幻灯片放映时使用快捷键。 (2)CurrentShowPosition属性:返回当前幻灯片在放映中的位置。 (3)DrawLine方法:在指定幻灯片放映视图中绘制直线。 (4)EraseDrawing方法:用于清除通过DrawLine方法或绘图笔工具在放映中绘制的直线。 (5)GotoSlide方法:用于切换指定幻灯片。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值