Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move To Next Page in Report Snapshot with code

Status
Not open for further replies.

Kristoph

Technical User
Jul 29, 2008
9
US
Hello all,

I am inserting a report into PowerPoint automatically with code. It is working well, but I'm only half way there. Is there any way to move to the next page in a Snapshot with code?

i.e., Page one of the Snapshot is on slide one of the PowerPoint. Page two of the Snapshot is on slide two of the PowerPoint... and so on?

Here is the code I have so far that works well for inserting the Snapshot into my PowerPoint template. Any advice is appreciated. Thank you.

Private Sub Command3_Click()
On Error GoTo Err_Command3_Click

Dim ppObj As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation

' Open up an instance of Powerpoint and the existing template.
Set ppObj = CreateObject("PowerPoint.Application")
ppObj.Visible = True
Set ppPres = ppObj.Presentations.Open("C:\PowerPointTemplate.ppt")

ppObj.ActiveWindow.Selection.SlideRange.Shapes.AddOLEObject(Left:=120, Top:=110, Width:=480, Height:=320, FileName:="C:\MyReport.snp", Link:=False).Select
ppObj.ActiveWindow.Selection.Unselect

Exit Sub

Err_Command3_Click:
MsgBox Err.Number & " " & Err.Description

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top