PowerPoint VBA: Changing the Pen Color of an Active Presentation

This PowerPoint VBA macro changes the pen color of an active presentation slide show.

Macro Example

Sub GetActivePresentationPath()

  ActivePresentation.SlideShowSettings.PointerColor.RGB = RGB(0, 255, 0)

End Sub

Description

(Application.)ActivePresentation

  ActivePresentation...

The Application.ActivePresentation property returns the active Presentation object.

obj-PowerPoint-Application-ActivePresentation

The ActivePresentation property is a member of the PowerPoint.Global class, so we can omit the Application property.

obj-PowerPoint-ActivePresentation

ActivePresentation.SlideShowSettings (Presentation.SlideShowSettings)

  ActivePresentation.SlideShowSettings...

The ActivePresentation.SlideShowSettings (Presentation.SlideShowSettings property) returns a SlideShowSettings object that represents the slide show settings for the presentation.

obj-PowerPoint-Presentation-SlideShowSettings

SlideShowSettings.PointerColor

  ActivePresentation.SlideShowSettings.PointerColor...

The SlideShowSettings.PointerColor property returns the pointer color (pen color) for the specified presentation as a ColorFormat object.

obj-PowerPoint-SlideShowSettings-PointerColor

ColorFormat.RGB (PointerColor.RGB)

  ActivePresentation.SlideShowSettings.PointerColor.RGB...

The PointerColor.RGB (ColorFormat.RGB property) returns or sets the red-green-blue (RGB) value of the specified color.

obj-PowerPoint-ColorFormat-RGB

In this macro, I am setting R=0, G=225, and B=0 to ColorFormat.RGB property.

Sub GetActivePresentationPath()

  ActivePresentation.SlideShowSettings.PointerColor.RGB = RGB(0, 255, 0)

End Sub

Properties

http://www.relief.jp/itnote/archives/powerpoint-vba-change-pen-color.php

Apply to

  • PowerPoint 2013
  • PowerPoint 2010
  • PowerPoint 2007