Get a VBA Module

Introduction

VBA (Visual Basic for Applications) modules in PowerPoint are used to automate tasks and add functionality that is not supported by the standard PowerPoint features. VBA allows you to write macros and create custom functions that can perform various operations, such as modifying slides, working with objects on a slide, managing animations, and much more. Use the following method to get modules from VBA projects.

GetVbaModule

API Information

API Type Description Resource
/slides/{name}/vbaProject/modules/{moduleIndex} GET Returns a VBA module from a presentation saved in a storage. GetVbaModule

Request Parameters

Name Type Location Required Description
name string path true The name of a presentation file.
moduleIndex integer path true The 1-based index of a VBA module.
password string header false The password to open the presentation.
folder string query false The path to the folder containing the presentation file.
storage string query false The name of the storage contaning the folder.

Examples

In the default storage, the document MyPresentation.pptm contains a VBA project with one module. Get the source code from the module.

The VBA module

cURL Solution

SDK Solutions

SDKs

Check Available SDKs to learn how to add an SDK to your project.