How to automate PowerPoint using VB
2014-06-24 17:10
357 查看
Microsoft has an article that explains how to automate PowerPoint using VB
For some odd reason they've entitled it How to automate Powerpoint using VB
Here's a quick example:
For some odd reason they've entitled it How to automate Powerpoint using VB
Here's a quick example:
Sub AutomatePowerPoint() ' This requires that you set a reference to PowerPoint in Tools, References ' You could later change these to As Object to avoid that necessity Dim oPPTApp As PowerPoint.Application Dim oPPTPres As PowerPoint.Presentation Dim sPresentationFile as String sPresentationFile = "C:\MyFiles\Somefile.PPT" ' Get a reference to PowerPoint app Set oPPTApp = New PowerPoint.Application ' set it visible or you may get errors - there are ways around this but they're ' beyond the scope of this FAQ oPPTApp.Visible = True ' minimize if you want to hide it: ' oPPTApp.WindowState = ppWindowMinimized ' Open our source PPT file, get a reference to it Set oPPTPres = oPPTApp.Presentations.Open(sPresentationFile) With oPPTPres ' Do stuff ... ' Show the number of slides in the file, for example msgbox .Slides.Count End With ' Cleanup ' Close the presentation oPPTPres.Close ' Quit PPT oPPTApp.Quit ' Release variables Set oPPTPres = Nothing Set oPPTApp = Nothing End Sub url:http://www.pptfaq.com/FAQ00115_How_to_automate_PowerPoint_using_VB.htm
相关文章推荐
- How to automate PowerPoint by using Visual C++ 5.0 or Visual C++ 6.0 with The Microsoft Foundation Classes
- prjGetWriteINIFile - How to Read-Write INI file using VB & API - 读取/写入INI文件 - VB6 + API - SourceCode - HackerJLY
- How To Automate Outlook Using Visual C++/MFC
- How to Convert PowerPoint to Flash Using Open Source Tools
- prjSendMailInUniversity - How to send email using VB & Winsock - 邮件发送接收程序 - VB6 + Winsock
- How to set IE proxy using VB.NET
- How to automate mail merge to Word using OLE and ODBC[VFP调用Word邮件合并—微软提供]
- How to automate Excel using MFC and worksheet functions
- How to invoke active dll written by VB using VC - VC如何调用VB写的Active Dll - 详解
- how to select data in multiple datatables after using join,group by and order by in Linq
- How to configure XDB for using ftp and http protocols with ASM [ID 357714.1]
- How to Integrate Excel in a Windows Form Application using the WebBrowser
- How to import gms to our project - using Android.mk
- How to Change the DBID and the DBNAME by using NID [ID 224266.1]
- how to build a codec using lib
- How to write an application that supports the Fast User Switching feature by using Visual Basic .NET or Visual Basic
- How To Monitor Remote Windows Machine Using Nagios on Linux
- http://www.roman10.net/how-to-compile-sqlite-for-android-using-ndk/
- How To Install 11.2 / 12.1 Database/Client Software In Silent Mode Without Using Response File