Class PrintRanges (PowerPoint VBA)

A collection of all the PrintRange objects in the specified presentation. Each PrintRange object represents a range of consecutive slides or pages to be printed. To use a PrintRanges class variable it first needs to be instantiated, for example


Dim prs as PrintRanges
Set prs = ActivePresentation.PrintOptions.Ranges

Add

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

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)

Arguments

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.

ClearAll

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


ActivePresentation.PrintOptions.Ranges.ClearAll

Count

Returns the number of objects in the specified collection.


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

Item

Returns a single PrintRange object from the specified PrintRanges collection.

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)