最新VBA最最精典的教程(基础入门)教学讲义ppt
- 格式:ppt
- 大小:485.50 KB
- 文档页数:122
PPT学习讲义ActivePresentation.Slides(2).Shapes.Placeholders(1).Delete ActivePresentation.SaveActivePresentation.NewWindow创建ppt文档。
增加一张slideWith Presentations.Add.Slides.Add Index:=1, Layout:=ppLayoutTitle.SaveAs "Sample"End With打开ppt文档。
Presentations.Open FileName:="c:\My Documents\pres1.ppt", _ ReadOnly:=msoTrue创建保存pptSub AddAndSave(pptPres As Presentation)pptPres.Slides.Add 1, 1pptPres.SaveAs pptPres.Application.Path & "\Added Slide"End SubSlide标题删除与恢复ActivePresentation.Slides(2).Shapes.Placeholders(1).Delete Application.ActivePresentation.Slides(2) _.Shapes.AddPlaceholder ppPlaceholderTitle当前演示文稿中添加一张幻灯片,为该幻灯片标题(幻灯片第一个占位符)和副标题添加文本Set myDocument = ActivePresentation.Slides(1)With ActivePresentation.Slides _.Add(1, ppLayoutTitle).Shapes.Placeholders.Item(1).TextFrame.TextRange.Text = "This is the title text".Item(2).TextFrame.TextRange.Text = "This is subtitle text"End With将主题或设计模式应用于当前pptActivePresentation.ApplyTheme若要在幻灯片中添加形状并返回一个代表新建形状的 Shape 对象,请使用 Shapes 集合的下列方法之一:AddCallout 、AddComment 、AddConnector 、AddCurve 、AddLabel 、AddLine 、AddMediaObject 、AddOLEObject 、AddPicture 、AddPlaceholder 、AddPolyline 、AddShape 、AddTable 、AddTextbox 、AddTextEffect 、AddTitle 。