Sub PrintHyperlinkedPresentations()
Dim oSld As Slide
Dim oPPT As Presentation
Dim iCount As Integer
Dim oPresCol As Collection
' This step is crucial since some of the paths can be relative.
' So the processing should always be with respect to the current
' folder of the parent presentation.
Call ChDir(ActivePresentation.Path)
' Create a collection containing the presentation paths.
Set oPresCol = New Collection
' Add the main presentation to the list.
' We assign the filename to the collection item as well as the key so a presentation
' is not printed twice.
oPresCol.Add LCase(ActivePresentation.FullName), _
LCase(ActivePresentation.FullName)
For Each oSld In ActivePresentation.Slides
For iCount = 1 To oSld.Hyperlinks.Count
If oSld.Hyperlinks(iCount).Address <> "" Then
' Do a basic check for a presentation check extension of the file
If LCase(Right(oSld.Hyperlinks(iCount).Address, 3)) = "ppt" Or _
LCase(Right(oSld.Hyperlinks(iCount).Address, 3)) = "pps" Then
'Add the presentation to the collection to be printed
oPresCol.Add LCase(oSld.Hyperlinks(iCount).Address), _
LCase(oSld.Hyperlinks(iCount).Address)
End If
End If
Next
Next
' Now print out each presentation using your desired properties
For iCount = 1 To oPresCol.Count
Debug.Print oPresCol(iCount)
Set oPPT = Application.Presentations.Open(oPresCol(iCount), True, , False)
With oPPT.PrintOptions
.OutputType = ppPrintOutputSlides
.PrintHiddenSlides = False
.FitToPage = True
End With
oPPT.PrintOut
oPPT.Close
Next
Set oPPT = Nothing
End Sub
|