Class Guides (PowerPoint VBA)

A collection of Guide objects in a presentation or custom layout. To use a Guides class variable it first needs to be instantiated, for example


Dim gds as Guides
Set gds = ActivePresentation.SlideMaster.CustomLayouts(1).Guides

Add

Adds a new drawing guide to the presentation, slide master, or custom layout.

Add (Orientation, Position)


Dim gui As Guide
Set gui = ActivePresentation.SlideMaster.CustomLayouts(1).Guides.Add(Orientation:=ppHorizontalGuide, Position:=)

Arguments

The following arguments are required:

Orientation (PpGuideOrientation) - Specifies the orientation of a drawing guide, either horizontal or vertical.

Possible return values are ppHorizontalGuide - Represents a horizontal guide, spanning from the left to right of the slide editing window, ppVerticalGuide - Represents a vertical guide, spanning from top edge to bottom of the slide editing window.

Position (Single) - The position of the guide along the specified axis.

Count

Returns the number of objects in the specified collection.


Dim lngCount As Long
lngCount = ActivePresentation.SlideMaster.CustomLayouts(1).Guides.Count

Item

Returns a Guide object from the collection.

Item (Index)

Index: The index number of the single Guide object in the collection to be returned.


Dim gui As Guide
Set gui = ActivePresentation.SlideMaster.CustomLayouts(1).Guides(Index:=1)