Class PrintRange (PowerPoint VBA)

The class PrintRange represents a single range of consecutive slides or pages to be printed.


To use a PrintRange class variable it first needs to be instantiated, for example

Dim pre as PrintRange
Set pre = ActivePresentation.PrintOptions.Ranges(Index:=1)

The following procedures can be used to set variables of type PrintRange: PrintRanges.Item, PrintRanges.Add and PrintOptions.Ranges


Deletes the specified PrintRange object.



Returns the number of the last slide in the specified print range.

Dim lngEnd As Long
lngEnd = ActivePresentation.PrintOptions.Ranges(1).End


Returns the parent object for the specified object.


Returns the number of the first slide in the range of slides to be printed.

Dim lngStart As Long
lngStart = ActivePresentation.PrintOptions.Ranges(1).Start


Returns a PrintRange object that represents a new print range to be added to the PrintRanges collection.

Syntax : expression.Add (Start, End)

Dim lngStart As Long: lngStart = 
Dim lngEnd As Long: lngEnd = 
Dim pre As PrintRange
Set pre = ActivePresentation.PrintOptions.Ranges.Add(Start:=lngStart, End:=lngEnd)


The following arguments are required:

Start (Long) - The number of the slide that is the starting slide in the range.

End (Long) - The number of the slide that is the ending slide in the range.


Clears all the print ranges from the PrintRanges collection. Use the Add method of the PrintRanges collection to add print ranges to the collection.



Returns the number of objects in the specified collection.

Dim lngCount As Long
lngCount = ActivePresentation.PrintOptions.Ranges.Count


Returns a single PrintRange object from the specified PrintRanges collection.

Syntax : expression.Item (Index)

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

Dim pre As PrintRange
Set pre = ActivePresentation.PrintOptions.Ranges(Index:=1)


Returns the parent object for the specified object.