Am trying to open, print and close embedded objects as part of a macro to print all of workbook including embedded files. I have the following which works ok if the embedded documents are only word files but I have been unable to adapt it to print PDF files. Is anybody able to offer any ideas??
Sub testprint()
Dim ChartList As Integer
Dim X As Integer
' Variable chartlist stores a count of all embedded charts.
ChartList = ActiveSheet.OLEObjects.Count
' Increments the counter variable 'X' in a loop.
For X = 1 To ChartList
' Selects the shape.
ActiveSheet.OLEObjects(X).Select
Selection.Verb Verb:=xlPrimary
' Makes chart active.
ActiveSheet.OLEObjects(X).Activate
' Prints one copy of active chart.
Set WordApp = GetObject(, "Word.Application")
WordApp.Activedocument.PrintOut
Next
WordApp.Quit
End Sub
Sub testprint()
Dim ChartList As Integer
Dim X As Integer
' Variable chartlist stores a count of all embedded charts.
ChartList = ActiveSheet.OLEObjects.Count
' Increments the counter variable 'X' in a loop.
For X = 1 To ChartList
' Selects the shape.
ActiveSheet.OLEObjects(X).Select
Selection.Verb Verb:=xlPrimary
' Makes chart active.
ActiveSheet.OLEObjects(X).Activate
' Prints one copy of active chart.
Set WordApp = GetObject(, "Word.Application")
WordApp.Activedocument.PrintOut
Next
WordApp.Quit
End Sub