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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to print selected pages with VB

Status
Not open for further replies.

wnazzaro

Technical User
Apr 27, 2005
1
US
I have a large report in Business Objects v5.0.2. The report stretches across three or more pages horizontially and over 100 pages down. I would like to print only the first page of each group. I've tried working with VB to do this, but haven't been successful. This is what I've tried:
Code:
Public Sub PrintSelectPages()
    Dim PgNm As Page
    Dim CurRpt As Report
    Dim CurDoc As Document
    Dim i As Integer
    
    Set CurRpt = Application.ActiveReport
    Set CurDoc = Application.ActiveDocument
    
    For i = 1 To CurRpt.NumberOfPages Step 4
        CurDoc.PrintDialog
        SendKeys "%g", Wait:=True
        SendKeys CStr(i), Wait:=True
        SendKeys "{Tab}", Wait:=True
        SendKeys CStr(i), Wait:=True
        SendKeys "{Enter}", Wait:=True
    Next
End Sub

Is it possible to do what I am trying to do? Any help is greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top