Results 1 to 2 of 2

Thread: Printing Problems

  1. #1

    Thread Starter
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Post

    Try this:
    Code:
    Option Explicit
    
    
    Function AddSlash(ByVal sString As String) As String
        If Right(sString, 1) = "\" Then AddSlash = "\"
        AddSlash = sString & AddSlash
    End Function
    
    
    Private Sub Command1_Click()
        Dim lFileNum As Long
        On Error Resume Next
        With CommonDialog1
            .CancelError = True
            .Flags = cdlPDDisablePrintToFile Or cdlPDNoPageNums Or cdlPDNoSelection Or cdlPDNoPageNums
            Call .ShowPrinter
            If Err.Number = cdlCancel Then Exit Sub
            Printer.Copies = .Copies
            Printer.Orientation = .Orientation
        End With
        lFileNum = FreeFile
        Open AddSlash(filList.Path) & filList.filename For Input As #lFileNum
            Printer.Print Input(LOF(lFileNum), #lFileNum)
        Close #lFileNum
        Call Printer.EndDoc
    End Sub
    ------------------
    Yonatan
    Teenage Programmer
    E-Mail: [email protected]
    ICQ: 19552879
    AIM: RYoni69

  2. #2
    New Member
    Join Date
    Oct 1999
    Posts
    12

    Post

    I have a list of files in a File List Box and I want to be able for the person to print the selected file in it
    I currently have

    commondialog1.showprinter
    printer.print(fillist.FileName)

    but that doesn't seem to work? Can anyone help me?

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width