VBA PowerPoint Online Guide and How to Record a Macro

末鹿安然 提交于 2019-12-12 13:52:09

问题


Could anyone recommend to me a good online guide to PowerPoint VBA? Also, does anyone has advice on how to record a macro in PowerPoint?


回答1:


To record a powerpoint macro:

  1. In the menu bar, click on Tools
  2. Mouse over Macro > and the submenu will be displayed
  3. Click the Record button - a new toolbar will be displayed
  4. Do your thing
  5. Click the stop button on the new macro toolbar

Click on Tools->Macro->Macros. Find the macro you just recorded and click the Edit button. That will show you what was recorded. Make your modifications and click the triangular run button (or push F5) to run your code.

As far as an online guide, I usually think of a question and use Google or ask a question here on StackOverflow.com. I've been able to answer most of my questions that way, I haven't found a particular main resource for all things Powerpoint VBA.

Also, you can find answers that can help you by looking into VBA articles for other MS Office products - a lot of things that are not Powerpoint-specific (general VBA) will be the same as for the other products.




回答2:


Microsoft remove macro recorder from PowerPoint 2007.

To view the struct of objects use Watch (Shift +F9) in object.

For Example

dim ppt as powerpoint.Presentation

set ppt =activepresentation

add watch to ppt to view the struct of object Presentation

otherwise

Add a new class module

in the class declare

Private WithEvents ppt As PowerPoint.Application

in comon module declare one instance from classCreate(default is Class1) using

set x= new class1

Now in module class you can get events for you presentation (in left combo up the code window)

Bruno Leite

Office Developer




回答3:


Can you describe what you are hoping to accomplish? There are dozens of VBA books out there for Word, Excel, etc. but "programming" in PowerPoint is not so common.

Here's a brief online "FAQ" for the newcommer:

http://skp.mvps.org/index.html#newbie

and a general howto:

http://www.pptfaq.com/FAQ00033.htm



来源:https://stackoverflow.com/questions/127006/vba-powerpoint-online-guide-and-how-to-record-a-macro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!