Member Avatar for gowans07

Hi,

I'm creating a program and a feature i wish to include is for customer orders to be printed out. I've got this code below which will add in the relevant data and create the text file, but when i come to print it will include the standard &f header and the page number onto the print out. Is there a way to disable this outside of vb, or anyway i can set it not to be printed?

FilePrint = App.Path & "\" & CmbCustomer.Text & "--" & LblOrderNo.Caption & ".txt"
    Open FilePrint For Append As #1
        Print #1,
        Data1.Refresh
        Do Until Data1.Recordset.EOF
                ProductCost = Data1.Recordset("Cost")
                ProductName = Data1.Recordset("Product Name")
                ProductDescription = Data1.Recordset("Product Description")
                If CmbProduct.Text = ProductName Then
                    ProductCostEx = ProductCost
                    ProductCostEx = ProductCostEx * TxtQuantity.Text
                    Print #1, CmbProduct.Text & vbTab & vbTab & vbTab & TxtQuantity.Text & vbTab & vbTab & vbTab; "£" & ProductCostEx
                    Print #1, vbTab & ProductDescription
                    Print #1,
                    Print #1, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "
                    Close #1
                    Exit Do
                End If
        Data1.Recordset.MoveNext
        Loop
        Close #1
    
    Open FilePrint For Input As #1
        Do Until EOF(1)
            Line Input #1, PrintTemp
            RtfFilePrint.Text = RtfFilePrint.Text & PrintTemp & vbNewLine
        Loop
    Close #1
    Printer.FontName = Arial
    Printer.FontSize = 10
    
    Printer.Print RtfFilePrint

Thanks, anymore info needed just say

Depends on how you do the printing. You should look into the runtime capabilities of your Printer object, and look for the settings (and set them AT runtime) there.

Member Avatar for gowans07

So simple, stupid me!! Its like word with Normal.dotm

Cheers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.