Programming PowerPoint With VBA Straight to the Point
()
About this ebook
Related to Programming PowerPoint With VBA Straight to the Point
Related ebooks
Mastering Microsoft Teams: Creating a Hub for Successful Teamwork in Office 365 Rating: 0 out of 5 stars0 ratingsMastering Game Development with PyGame: From Basics to Advanced Techniques Rating: 0 out of 5 stars0 ratingsTeach Yourself VISUALLY Microsoft Teams Rating: 0 out of 5 stars0 ratingsGd Script Rating: 0 out of 5 stars0 ratingsTest Driven Development A Complete Guide - 2020 Edition Rating: 0 out of 5 stars0 ratingsTeaching with Microsoft Teams: Student Engagement Strategies Rating: 0 out of 5 stars0 ratingsExcel Functions and Formula Combinations Rating: 0 out of 5 stars0 ratingsProfessional C# and .NET Rating: 0 out of 5 stars0 ratingsPython Games from Zero to Proficiency (Intermediate): Python Games From Zero to Proficiency, #1 Rating: 0 out of 5 stars0 ratingsBuilding Web Applications with Python and Neo4j Rating: 0 out of 5 stars0 ratingsElementary Statistics Using SAS Rating: 0 out of 5 stars0 ratingsCracking the Harmony Code: Nature's Surprising Secrets for Getting Along While Getting Your Way Rating: 0 out of 5 stars0 ratingsProgramming in Visual Basic (VB): For Visual Studio Rating: 0 out of 5 stars0 ratingsBusiness Leadership Under Fire: Nine Steps to Rescue and Transform Organizations Rating: 3 out of 5 stars3/5Learn OpenGL ES: For Mobile Game and Graphics Development Rating: 0 out of 5 stars0 ratingsMastering VBA for Microsoft Office 365 Rating: 0 out of 5 stars0 ratingsComprehensive Guide to Personal Cybersecurity: Personal Cybersecurity Practices for a Safer Digital Life Rating: 0 out of 5 stars0 ratingsVBA For Dummies Rating: 4 out of 5 stars4/5Data Teams: A Unified Management Model for Successful Data-Focused Teams Rating: 0 out of 5 stars0 ratingsGame Development Unleashed: Harnessing ChatGPT's Power for Game Creation Rating: 1 out of 5 stars1/5Introduction to Amazon AWS Rating: 0 out of 5 stars0 ratingsManaging the Unknown: A New Approach to Managing High Uncertainty and Risk in Projects Rating: 2 out of 5 stars2/5Data Management Solutions Using SAS Hash Table Operations: A Business Intelligence Case Study Rating: 0 out of 5 stars0 ratings
Programming For You
Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsPython Projects for Beginners: A Ten-Week Bootcamp Approach to Python Programming Rating: 0 out of 5 stars0 ratingsThe Unofficial Guide to Open Broadcaster Software: OBS: The World's Most Popular Free Live-Streaming Application Rating: 0 out of 5 stars0 ratingsPokemon Go: Guide + 20 Tips and Tricks You Must Read Hints, Tricks, Tips, Secrets, Android, iOS Rating: 5 out of 5 stars5/5Teach Yourself C++ Rating: 4 out of 5 stars4/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5The Little SAS Book: A Primer, Sixth Edition Rating: 5 out of 5 stars5/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5101 Amazing Nintendo NES Facts: Includes facts about the Famicom Rating: 4 out of 5 stars4/5
Reviews for Programming PowerPoint With VBA Straight to the Point
0 ratings0 reviews
Book preview
Programming PowerPoint With VBA Straight to the Point - Eduardo N Sanchez
About the Author
Eduardo N. Sanchez is a Brazilian Chemical Engineer with a long-time penchant for computers. Since college he has been programming using languages such as Fortran, Basic, Algol, Pascal, C and most recently VBA.
Eduardo enjoys answering Excel and Office questions at Internet forums, as this is a great way to get in touch with topics that could otherwise remain unnoticed. When he is not tackling a computational challenge with electronic music in the background, Eduardo likes to watch Star Trek episodes and play with the family’s Dachshund.
He is also the author of Excel and the World Wide Web – Straight to the Point.
Acknowledgments
I want to thank my editor Bill Jelen for embarking in a project which is not focused on our beloved Excel…
Thanks also to all blog posters and Internet site owners who share valuable technical knowledge for free; even the most experienced user will benefit from reading well-constructed articles. After retirement I plan to build my own little programming corner online…
Finally, thanks to my family for being always supportive on all my endeavors, and to my co-workers and Web posters who keep me on my toes by asking PowerPoint questions of varying difficulty levels.
Code used in this book
The code examples are available for download at
https://www.mrexcel.com/download-center/powerpoint-with-vba-5762/
1 Basic Operations
Introduction
There is a joke saying that PowerPoint is a free application that comes along when you buy Excel…
Actually, PowerPoint is a complex program that offers everything you need to create and manage professionally built presentations.
This book assumes you are already a PowerPoint user who wants to automate and enhance your presentations using Visual Basic for Applications, which is currently the Office programming language. It is also a pre-requisite that you have basic knowledge on how VBA works, as we do not have room here to teach it from the ground up.
We will review some concepts, but the main goal of this book will be to show how VBA can make PowerPoint even better. Welcome aboard!
Creating a simple presentation
Our first example is quite straightforward: the code generates a new presentation with six slides, each one containing a title and a bulleted list. The picture below shows the final result. Observe that the chosen layout contains two shapes; the first one will hold the slide title whereas the second will be used for the list.
Sub AddSlides()
Dim Pre As Presentation, sld As Slide, i%, j%
Set Pre = Presentations.Add(msoTrue)
j = 1
For i = 1 To 6
Set sld = Pre.Slides.Add(Index:=Pre.Slides.Count + 1, Layout:=ppLayoutText)
sld.Shapes(1).TextFrame.TextRange = Title of Slide
&i
sld.Shapes(2).TextFrame.TextRange = Line
&CStr(j) &vbNewLine& _
Line
&CStr(j + 1) &vbNewLine& Line
&CStr(j + 2) &vbNewLine
j = j + 3
Next
End Sub
This presentation was created with VBA
Where is the macro recorder?
Excel programmers know of this handy tool that records actions and generates the corresponding code. It often requires adjustments, but will give you the necessary properties and methods for that particular task. For example, if you format some text with the recorder turned on, it will give you VBA code that you can play back to do the same job again.
Unfortunately, since PowerPoint 2007 Microsoft removed this functionality from the program.
Object Browser and Intellisense
Two features that will help finding needed properties and methods are the object browser window and the so called Intellisense menu.
To activate the object browser view, just press the F2 key when in the VB editor; you will see something similar to the image beneath. It can be used to browse the object tree and search for the available elements. To return to the code window, press F7.
Choose a class to see a list of its members
Another useful feature is the dropdown menu that appears when you type a period after an object in the VB editor. It will list most of the valid properties and methods you can use with that specific object. To make sure this option is active,