|
-
April 18th, 2001, 01:12 PM
#1
printer help
Using this code does anyone know what code I need to add so that the common dialog combo box appears so that I can select either "ok" or "cancel". Thank you.
Private Sub mnuPrint_Click()
Dim Item As Integer
Dim ErrHndlr As Integer
On Error GoTo ErrHndlr
cdlOne.CancelError = True
cdlOne.ShowPrinter
On Error GoTo 0
' Prints the contents of the lstShopping list box.
For Item = 0 To lstShopping.ListCount - 1
Printer.Print lstShopping.List(Item)
Next
Printer.EndDoc
Exit Sub
ErrHndlr:
End Sub
Archie Kantzavelos
-
April 18th, 2001, 01:53 PM
#2
Re: printer help
I just tried it it works
Private Sub Command1_Click()
On Error Resume Next
List1.AddItem "c:\zip\junk.txt" ' or set the .Text property to some string value
List1.ListIndex = 0
With CommonDialog1
.CancelError = True
.Flags = cdlPDReturnDC + cdlPDHidePrintToFile + cdlPDNoPageNums + cdlPDNoSelection + cdlPDNoWarning
.ShowPrinter
End With
If (Err.Number <> cdlCancel) Then
Printer.Print List1.Text
Printer.EndDoc
End If
On Error GoTo 0
End Sub
I did not do Loop for this test
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|