问题
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:
- In the menu bar, click on Tools
- Mouse over Macro > and the submenu will be displayed
- Click the Record button - a new toolbar will be displayed
- Do your thing
- 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