Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

MicrosoftPowerPoint connector

Updated on October 19, 2022

Use the MicrosoftPowerPoint connector to integrate Microsoft PowerPoint 2019 presentations into your solution. You can create, modify, and run a presentation.

The MicrosoftPowerPoint connector exposes the underlying COM components so that you can automate almost any PowerPoint task. The object model provides the following interfaces for you to work with:

  • Applications – Provides access to PowerPoint and contains a collection of presentations.
  • Presentations – Provides access to presentation-level operations and contains a slide collection.
  • Slides – Provides access to a single slide and contains a shape collection (individual items on each slide are called shapes).
  • Shapes – Provides access to a single shape on a slide.

Note: For more information on the PowerPoint object model, see PowerPoint object model overview.

When you add the connector to an automation, Pega Robot Studio places it in the Globals contaner of the project, so it can be used throughout the project.

The MicrosoftPowerPoint connector has the following properties, methods, and events.

Properties

PropertyDescription
DisplayAlerts

For PowerPoint, set this property to False if you do not want to view prompts and alert messages while a program is running. If a message requires a response, PowerPoint chooses the default response.

If you set this property to False, PowerPoint resets this property to True when the code is finished, unless you are running cross-process code.

When you use the SaveAs method to overwrite a file, the Overwrite alert defaults to No. PowerPoint selects the Yes response when you set the DisplayAlerts property to False. When you use the SaveAs method to overwrite a file, the Overwrite alert defaults to No. PowerPoint selects the Yes response when you set the DisplayAlerts property to False.

The default is True.

IsRunningIndicates whether the Microsoft Office application is running.
MissingGenerates a System.Reflection.Missing.Value that you can use as input for method parameters that you do not want to specify.
ModeSpecifies how to open the presentation file.
PowerPointApplicationReferences the Microsoft PowerPoint COM instance.
PowerPointApplicationActivePresentationSpecifies the active presentation in the PowerPoint application.
PowerPointApplicationPresentationsIdentifies the presentations collection in PowerPoint.
PowerPointApplicationSlidesLists the slides collection in PowerPoint.
PowerPointPresentationRefers to the PowerPoint presentation COM instance.
PowerPointPresentationSlidesSpecifies the collection of slides in the PowerPoint presentation that you want the connector to open.
PowerPointWindowsHeightSpecifies the height of the PowerPoint window.
PowerPointWindowsLeftSpecifies the left position of the PowerPoint window.
PowerPointWindowsTopSpecifies the top position of the PowerPoint window.
PowerPointWindowsWidthDefines the width of the PowerPoint window.
PresentationSpecifies the name of the presentation file.
SlideCountIndicates the number of slides in the presentation.
SupportedNameIndicates the supported Microsoft Office name.
SupportedVersionIndicates the supported Microsoft Office version.
ThisReferences the connector object.
VersionSpecifies the PowerPoint version.
VisibleSpecifies whether the PowerPoint main window is visible.

Methods

MethodDescriptionParametersReturn Types
ActivateActivates PowerPoint to bring it into focus. Boolean, out string message
AddPictureToSlideAdds a picture to a section (shape) of an existing slide. Slide slide, Int32 shapeIndex, string picturePathBoolean, out string message
AddSlideAdds a slide to the presentation. Int32 index, PpSlideLayout layoutBoolean, out _Slide slide, out string
AddTextToSlideAdds text to a section (shape) of an existing slide. Slide slide, Int32 shapeIndex, string textBoolean, out string message
ApplyThemeApplies a theme to all slides in the presentation. String themeFile Boolean, out string message
CloseCloses a currently opened presentation. Void
CopySlideCopies a slide to the clipboard. Int32 index Boolean, out string message
CutSlideCopies a slide to the clipboard and removes the slide from the presentation. Int32 index Boolean, out string message
DeleteSlideDeletes a slide from the presentation. Int32 index Boolean, out string message
EndSlideShowEnds the slide show. Boolean, out string message
ExportToPdfSaves the currently opened presentation as a PDF file. string path Boolean, out string message
GetSlideGets a slide from the presentation. Int32 index Boolean, out _Slide slide, out string message
GetSlideShapesGets shapes from a slide. Slide slide Boolean, out Shapes shape, out string message
GetTextFromSlideGets the text from a shape on a slide in the presentation. Slide slide, Int32 shapeIndex Boolean, out string text, out string message
Open (1 parameter) Creates and opens a presentation using the file path that you specify. string presentation Void
Open (2 parameters)

Creates and opens a presentation using the file path that you specify.

Returns False and an error message if the operation fails.

string presentation Boolean, out string message
Open (3 parameters)

Creates and opens a presentation using the file path that you specify and applies the read-only property.

Returns False and an error message if the operation fails.

string presentation, Boolean readOnlyBoolean, out string message
PasteChartPastes a chart into a slide on the shape that you specify. Slide slide, Int32 shapeIndexBoolean, out string message
PasteSlideAdds the slide currently on the clipboard to the presentation. Int32 index Boolean, out string message
RefreshChartDataRefreshes all the linked charts with the originating data. Boolean, out string message
ReplaceTextFinds and replaces text. string fromText, string toText, Int32 slideIndex, Int32 shapeIndexBoolean, out string message
RunMacro (1 parameter) Runs a Visual Basic macro or calls a function. string macroName Object
RunMacro (6 parameters) Runs a Visual Basic macro or calls a function. All param1-param? parameters are optional. string macroName, Object param1, Object param2, Object param3, Object param4, Object param5Object
Save (no parameters) Saves the currently opened presentation. Void
Save (1 parameter)

Saves the currently opened presentation.

Returns False and an error message if the operation fails.

Boolean, out string message
SaveAs (1 parameter) Saves the currently opened presentation using the file name that you specify. string fileName Void
SaveAs (2 parameters)

Saves the currently opened presentation using the file name that you specify.

Returns False and an error message if the operation fails.

string fileName Boolean, out string message
SetActiveSlideSets the slide indicated in the Int32 index as the active slide. Int32 index Boolean, out string message
SetSlideTransitionSets the transition attributes of a slide. Slide slide, PpEntryEffect entryEffect, PpTransitionSpeed speed, Single advanceTime, Boolean advanceOnTime, Boolean advanceOnClickBoolean, out string message
SetTextColorSets the color for the text in a shape. Slide slide, Int32 shapeIndex, Color fontColor Boolean, out string message
SetTextFontSpecifies the font for the text in a shape. Slide slide, Int32 shapeIndex, string fontNameBoolean, out string message
SetTextSizeSets the font size for the text in a shape. Slide slide, Int32 shapeIndex, Single fontSizeBoolean, out string message
SetTextStyleSets the style for the text in a shape. Slide slide, Int32 shapeIndex, Boolean bold, Boolean italic, Boolean underlineBoolean, out string message
ShapeCountReturns the number of shapes in a slide. Slide slide Int32
StartStarts the PowerPoint connector. Void
StartSlideShowStarts the slide show from the slide that you specify. Int32 slideIndex Boolean, out string message
StopStops the PowerPoint connector. Void

Events

EventDescription
AfterNewPresentationOccurs after a presentation is created.
AfterPresentationOpenOccurs after a presentation is opened.
ColorSchemeChangedOccurs after the color scheme is changed.
NewPresentationOccurs after a presentation is created, when it is added to the Presentations collection.
PresentationBeforeCloseRepresents a Presentation object before it closes.
PresentationBeforeSaveOccurs before a presentation is saved.
PresentationCloseOccurs immediately before any open presentation closes, when it is removed from the Presentations collection.
PresentationCloseFinalRepresents the closing of the final Presentation object.
PresentationNewSlideOccurs after a slide is added to the presentation.
PresentationOpenOccurs after an existing presentation is opened, as it is added to the Presentations collection.
PresentationPrintOccurs before a presentation is printed.
PresentationSaveOccurs before a presentation is saved.
PresentationSyncOccurs when the local copy of a presentation that is part of a Document Workspace is synchronized with the copy on the server.
ProtectedViewWindowActivateOccurs when any protected view window is activated.
ProtectedViewWindowBeforeCloseOccurs immediately before a protected view window or a document in a protected view window closes.
ProtectedViewWindowBeforeEditOccurs immediately before editing is enabled on the document in the specified protected view window.
ProtectedViewWindowDeactivateOccurs when a protected view window is deactivated.
ProtectedViewWindowOpenOccurs when a protected view window is opened.
SlideSelectionChangedOccurs at different times depending on the current view.
SlideShowBeginOccurs when you start a slide show.
SlideShowEndOccurs after a slide show ends, after the last SlideShowNextSlide event occurs.
SlideShowNextBuildOccurs upon a mouse-click or timing animation, but before the animated object becomes visible.
SlideShowNextClickOccurs on the next click of the slide.
SlideShowNextSlideOccurs immediately before the transition to the next slide. For the first slide, this event occurs immediately after the SlideShowBegin event.
SlideShowOnNextOccurs when the user clicks Next to move within the current slide. Occurs when the user clicks Next to move within the current slide.
SlideShowOnPreviousOccurs when the user clicks Previous to move within the current slide.
WindowActivateOccurs when the application window or any document window is activated.
WindowBeforeDoubleClickOccurs when you double-click a shape, a slide, a notes page, or text. This event is triggered by the MouseUp event.
WindowBeforeRightClickOccurs when you right-click a shape, a slide, a notes page, or text. This event is triggered by the MouseUp event.
WindowDeactivateOccurs when the application window or any document window is deactivated.
WindowSelectionChangeOccurs when the selection of text, a shape, or a slide in the active document window changes, whether in the user interface or in the code.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us