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:

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

最新文章

  1. ScrollView 嵌套ListView、RecyclerView(持续更新)
  2. 什么是Alpha通道?
  3. 为什么js加事件时不要写括号
  4. How-to: Enable User Authentication and Authorization in Apache HBase
  5. .net5的异步
  6. DOM与元素节点内联样式
  7. fastjson是阿里巴巴的开源JSON解析库
  8. 验证码I
  9. SQL入门经典(一)之简介
  10. 如何把匿名类型.GetType()返回的对象传进泛型里面[转]
  11. "ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效"的快速解决方法
  12. html的空格显示距离问题
  13. 高效开发之SASS篇
  14. zoj 1508 poj 1201 Intervals
  15. arcgis api for js入门开发系列九热力图效果
  16. [2012-06-18]awk利用关联数组合并记录
  17. [bzoj5016][Snoi2017]一个简单的询问
  18. (六)QDialog,QMessageBox,QFileDialog,QColorDialog颜色,QFontDialog字体
  19. Spring详解(七)------AOP 注解
  20. HDU 1077

热门文章

  1. bzoj 1622: [Usaco2008 Open]Word Power 名字的能量【模拟】
  2. P3469 [POI2008]BLO-Blockade(Tarjan 割点)
  3. 例题 5-1 STL
  4. 洛谷2019 3月月赛 T4
  5. RecycleView的简单应用
  6. HDU 1879(最小生成树)
  7. Hbase源码分析:server端RPC
  8. RabbitMQ - Publisher的消息确认机制
  9. DNN结构构建:NAS网络结构搜索和强化学习、迁移学习
  10. parsley之验证属性设置