Logo
Live Scores
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
 
 
Windows Server

Microsoft PowerPoint 2010 : Enhancing a Presentation with VBA & Setting Developer Options

6/29/2011 11:39:27 AM

Enhancing a Presentation with VBA

Office applications like PowerPoint, Access, Excel, Word, and Visio share a common programming language: Visual Basic for Applications (VBA). With VBA, you can develop applications that combine tools from these Office products, as well as other programs that support VBA. Because of the language’s power and flexibility, programmers often prefer to use VBA to customize their Office applications.

Introducing the Structure of VBA

VBA is an object-oriented programming language because, when you develop a VBA application, you manipulate objects. An object can be anything within your presentation, such as a shape, text box, picture, or table. Even PowerPoint itself is considered an object. Objects can have properties that describe the object’s characteristics. Text boxes, for example, have the Font property, which describes the font PowerPoint uses to display the text. A text box also has properties that indicate whether the text is bold or italic.

Objects also have methods, actions that can be done to the object. Deleting and inserting are examples of methods available with a record object. Closely related to methods are events. An event is a specific action that occurs on or with an object. Clicking a button initiates the Click event for the button object. VBA also refers to an event associated with an object as an event property. The form button, for example, has the Click event property. You can use VBA to either respond to an event or to initiate an event.

Writing VBA Code

A VBA programmer types the statements, or code, that make up the VBA program. Those statements follow a set of rules, called syntax, that govern how commands are formulated. For example, to change the property of a particular object, the command follows the general form:

Object.Property = Expression

Where Object is the name of a VBA object, Property is the name of a property that object has, and Expression is a value that will be assigned to the property. The following statement sets the ViewType property of the ActiveWindow to Slide View:

ActiveWindow.ViewType = ppViewSlide”

You can use Office and VBA’s online Help to learn about specific object and property names. If you want to apply a method to an object, the syntax is:

Object.Method arg1, arg2, ...

Where Object is the name of a VBA object, Method is the name of method that can be applied to that object, and arg1, arg2, ... are optional arguments that provide additional information for the method operation. For example, to exit all running slide shows, you could use the Exit method as follows:

SlideShowWindows(1).View.Exit

Working with Procedures

You don’t run VBA commands individually. Instead they are organized into groups of commands called procedures. A procedure either performs an action or calculates a value. Procedures that perform actions are called Sub procedures. You can run a Sub procedure directly, or Office can run it for you in response to an event, such as clicking a button or opening a form. A Sub procedure initiated by an event is also called an event procedure. Office provides event procedure templates to help you easily create procedures for common events. Event procedures are displayed in each object’s event properties list.

A procedure that calculates a value is called a function procedure. By creating function procedures you can create your own function library, supplementing the Office collection of built-in functions. You can access these functions from within the Expression Builder, making it easy for them to be used over and over again.

Working with Modules

Procedures are collected and organized within modules. Modules generally belong to two types: class modules and standard modules. A class module is associated with a specific object. In more advanced VBA programs, the class module can be associated with an object created by the user. Standard modules are not associated with specific objects, and they can be run from anywhere within a database. This is usually not the case with class modules. Standard modules are listed in the Database window on the Modules Object list.

Building VBA Projects

A collection of modules is further organized into a project. Usually a project has the same name as a presentation. You can create projects that are not tied into any specific presentation, saving them as PowerPoint add-ins that provide extra functionality to PowerPoint.

Using the Visual Basic Editor

You create VBA commands, procedures, and modules in Office’s Visual Basic Editor. This is the same editor used by Excel, Word, and other Office programs. Thus, you can apply what you learn about creating programs in PowerPoint to these other applications.

The Project Explorer

One of the fundamental tools in the Visual Basic Editor is the Project Explorer. The Project Explorer presents a hierarchical view of all of the projects and modules currently open in PowerPoint, including standard and class modules.

The Modules Window

You write all of your VBA code in the Modules window. The Modules window acts as a basic text editor, but it includes several tools to help you write error-free codes. PowerPoint also provides hints as you write your code to help you avoid syntax errors.

The Object Browser

There are hundreds of objects available to you. Each object has a myriad of properties, methods, and events. Trying to keep track of all of them is daunting, but the Visual Basic Editor supplies the Object Browser, which helps you examine the complete collection of objects, properties, and methods available for a given object.

Viewing the Visual Basic Editor




Setting Developer Options

The Developer tab is a specialized Ribbon that you can use to access developer controls, write code, or create macros. You can set an option in the Customize Ribbon section (New!) in PowerPoint Options to show or hide the Developer tab. As a developer, you can also set an option to show errors in your user interface customization code.

Set Developer Options

Click the File tab, and then click Options.

In the left pane, click Customize Ribbon.

Select the Developer check box to display the Developer tab.


In the left pane, click Advanced.

Select the Show add-in user interface errors check box.

Click OK.



Other -----------------
- Windows Server 2008 R2 : Manage Disk Storage - Manage Disk Storage Quotas
- Windows Server 2008 R2 : Work with RAID Volumes - Understand RAID Levels & Implement RAID
- Exchange Server 2010 : Perform Essential Public Folder Management (part 3) - Configure Client Connectivity
- Exchange Server 2010 : Perform Essential Public Folder Management (part 2) - Define Public Folder Permissions
- Exchange Server 2010 : Perform Essential Public Folder Management (part 1) - Manage Public Folder Content
- Microsoft Dynamics CRM 2011 : Using Microsoft Dynamics CRM for Outlook - Configuring Synchronization Filters
- Microsoft Dynamics CRM 2011 : Going Offline with Microsoft Dynamics CRM for Outlook
- Microsoft Dynamics CRM 2011 : Deleting Records in Microsoft Dynamics CRM for Outlook
- SharePoint 2010 : Securing a Web Application (part 2) - Managing Web Part Security & Self-Service Site Creation
- SharePoint 2010 : Securing a Web Application (part 1) - How Zones, Web Applications, and Security Work Together to Provide Secure Solutions
 
 
REVIEW
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- Sigma 24mm f/1.4 DG HSM Art

- Canon EF11-24mm f/4L USM

- Creative Sound Blaster Roar 2

- Alienware 17 - Dell's Alienware laptops

- Smartwatch : Wellograph

- Xiaomi Redmi 2
 
VIDEO TUTORIAL
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
 
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
Top 10
- VMware View 5 Implementation : Installing Microsoft SQL Server (part 5)
- VMware View 5 Implementation : Installing Microsoft SQL Server (part 4)
- VMware View 5 Implementation : Installing Microsoft SQL Server (part 3)
- VMware View 5 Implementation : Installing Microsoft SQL Server (part 2)
- VMware View 5 Implementation : Installing Microsoft SQL Server (part 1)
- VMware View 5 Implementation : Preparing a vCenter Installation
- Microsoft Excel : How to Use the VLookUp Function
- Fix and Tweak Graphics and Video (part 3) : How to Fix : My Screen Is Sluggish - Adjust Hardware Acceleration
- Fix and Tweak Graphics and Video (part 2) : How to Fix : Text on My Screen Is Too Small
- Fix and Tweak Graphics and Video (part 1) : How to Fix : Adjust the Resolution
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro