-
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
-
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