954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Txt File Header / Footer removal

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

gowans07
Light Poster
48 posts since Sep 2011
Reputation Points: 10
Solved Threads: 1
 

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.

BitBlt
Master Poster
711 posts since Feb 2011
Reputation Points: 367
Solved Threads: 109
 

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

Cheers

gowans07
Light Poster
48 posts since Sep 2011
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You