使用MergeWithBaseline将两个幻灯片组合并为一个幻灯片组.docx_第1页
使用MergeWithBaseline将两个幻灯片组合并为一个幻灯片组.docx_第2页
使用MergeWithBaseline将两个幻灯片组合并为一个幻灯片组.docx_第3页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

e800,国内最具活力的IT门户网站。【e800编译】此示例演示如何合并了两个Microsoft PowerPoint 2010演示文稿合并成一个幻灯片组。此代码段是Office 2010的101项VBA代码示例中的一部分。与其它示例一样,这些将可以直接写入您的代码中。每块示例代码包含约5至50行的代码,分别演示了一个独特的功能或功能集,在VBA或VB以及C中(在Visual Studio 2010中创建)。每个示例之中都会包含代码以及相应注释,这样您就可以直接运行获取预期的结果,或者是根据代码注释提示来调整环境,运行示例代码。Microsoft Office 2010提供了你所需要的工具来创建功能强大的应用程序。Microsoft Visual Basic Application(VBA)代码示例可以帮助你创建自己的应用程序,以执行特定功能或者以此为出发点实现更为复杂的功能。实例代码下面我们来测试Presentation.MergeWithBaseline方法,你必须首先创建三个幻灯示例。首先从创建Baseline.pptx开始,接着在其中创建标题页已经另外五张幻灯片,标题分别为:标题页,幻灯片1,幻灯片2,幻灯片3,幻灯片4,幻灯片5。将Baseline.pptx保存为BaseLine1.pptx,删除幻灯片1,幻灯片4和幻灯片5。在BaseLine1.pptx中,将幻灯片3修改为幻灯片3A“。完成之后BaseLine1.pptx将包含以下幻灯片:标题页,幻灯片2,幻灯片3A关闭BaseLine1.pptx,接着将BaseLine.pptx另存为BaseLine2.pptx。在BaseLine2.pptx中删除幻灯片5,这样你将保留下的幻灯如下:标题,幻灯片1,幻灯片2,幻灯片3,幻灯片4运行下面的代码演示Presentation.MergeWithBaseLine,AcceptAll,RejectAll以及InMergeMode成员。如果您选择拒绝所有的修改,你将无法测试合并结果。将此代码复制到BaseLine2.pptx中的一个模块,然后按F8测试运行。Sub TestMergeWithBaseline() Fix up these constants to match your own environment:Const withPresentation As String = C:TempBaseLine1.pptxConst baseLinePresentation As String = C:TempBaseLine.pptxIf ActivePresentation.InMergeMode Then If youre currently in Merge mode, you must end the review before starting the merge.ActivePresentation.EndReviewElseActivePresentation.MergeWithBaseline withPresentation, baseLinePresentation If single-stepping, look now in PowerPoint to see what it has done. On Slide 1, youll see an indicator that the slide has been deleted. On Slide 3, youll see an indicator that the title has been changed. In the slide tray, youll see an indicator that Slide 4 has been deleted and after Slide 4, youll see an indicator that Slide 5 has been deleted.If ActivePresentation.InMergeMode Then In case you ended merge mode in the user interface, theres nothing to do here. Cant hurt to check.If MsgBox(Accept all changes?, vbOKCancel, MergeWithBaseline) = vbOK ThenActivePresentation.AcceptAllElseActivePresentation.RejectAllEnd IfEnd IfEnd If If you accepted revisions, in PowerPoint you can now see the Revision pane indic

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论