kiwicanta7
New Member
- Joined
- May 3, 2021
- Messages
- 15
- Office Version
- 2016
- Platform
- Windows
Hello!
So I'm trying to add a button to my Excel document that I can hit to print off specific slides of a particular PowerPoint. What I found will apparently print off the entire thing if it's able to before PowerPoint closes again, but I'm trying to get it to print specific pages. How would I alter the code below to do that so I can attempt to test this without printing off a ton of pages? Appreciate the help!
Try this modification.[vba]Sub test()
Dim PPT As Object
Set PPT = CreateObject("powerpoint.Application")
PPT.Visible = True
PPT.Presentations.Open ("C:\Documents and Settings\Pete Bryant\Desktop\test\a.ppt")
PPT.ActivePresentation.PrintOut
PPT.ActivePresentation.Close
PPT.Presentations.Open ("C:\Documents and Settings\Pete Bryant\Desktop\test\b.ppt")
PPT.ActivePresentation.PrintOut
PPT.ActivePresentation.Close
PPT.Quit
Set PPT = Nothing
End Sub[/vba]
So I'm trying to add a button to my Excel document that I can hit to print off specific slides of a particular PowerPoint. What I found will apparently print off the entire thing if it's able to before PowerPoint closes again, but I'm trying to get it to print specific pages. How would I alter the code below to do that so I can attempt to test this without printing off a ton of pages? Appreciate the help!
Try this modification.[vba]Sub test()
Dim PPT As Object
Set PPT = CreateObject("powerpoint.Application")
PPT.Visible = True
PPT.Presentations.Open ("C:\Documents and Settings\Pete Bryant\Desktop\test\a.ppt")
PPT.ActivePresentation.PrintOut
PPT.ActivePresentation.Close
PPT.Presentations.Open ("C:\Documents and Settings\Pete Bryant\Desktop\test\b.ppt")
PPT.ActivePresentation.PrintOut
PPT.ActivePresentation.Close
PPT.Quit
Set PPT = Nothing
End Sub[/vba]