U
URQUILLA
I guess I fixed my own problem . I looked every posting but just i coudn't
find what I was looking for. I needed to specify a #of copies to print. So
this is how the code looks like it if you need it.
For expert programmers please critize my code if there is something leaking
Or you need to add. Thank you.
Private Sub Command587_Click()
lblPath.Tag = strPath & "\FileName.doc"
lblPath.Caption = "Printing " & "... " & lblPath.Tag
lblPath.HyperlinkAddress = lblPath.Tag
doPrintBacking lblPath.Tag
End Sub
Public Function doPrintBacking(FileName As String)
On Error Resume Next
Dim strInput As Integer, noOfCopies As Integer
strInput = InputBox("Enter 1=for RICHO, Enter 2=for MINOLTA, 3=CANON")
If strInput > 0 Then
noOfCopies = InputBox("Enter # of Copies")
If noOfCopies > 0 Then
Set mobjWOrdApp = CreateObject("Word.Application")
mobjWOrdApp.Documents.Open conTEMPLATE_NAME
With mobjWOrdApp
.Visible = False
If strInput = 1 Then
.ActivePrinter = "\\PRNTRM\RICOH"
Forms!fPrintBacking!lblStatus.Caption = "-> Printing on RICOH \\ ->
" & noOfCopies & " Copies..."
ElseIf strInput = 2 Then
.ActivePrinter = "\\PRNTRM\MINOLTA"
Forms!fPrintBacking!lblStatus.Caption = "-> Printing on MINOLTA \\
-> " & noOfCopies & " Copies..."
ElseIf strInput = 3 Then
.ActivePrinter = "\\PRNTRM\Canon"
Forms!fPrintBacking!lblStatus.Caption = "-> Printing on CANON \\ ->
" & noOfCopies & " Copies..."
End If
DoEvents
.PrintOut Background:=False
.Documents.Application.PrintOut FileName:=conTEMPLATE_NAME,
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=noOfCopies
.ActiveDocument.Close False
.Quit
End With
End If
End If
Set mobjWOrdApp = Nothing
End Function
find what I was looking for. I needed to specify a #of copies to print. So
this is how the code looks like it if you need it.
For expert programmers please critize my code if there is something leaking
Or you need to add. Thank you.
Private Sub Command587_Click()
lblPath.Tag = strPath & "\FileName.doc"
lblPath.Caption = "Printing " & "... " & lblPath.Tag
lblPath.HyperlinkAddress = lblPath.Tag
doPrintBacking lblPath.Tag
End Sub
Public Function doPrintBacking(FileName As String)
On Error Resume Next
Dim strInput As Integer, noOfCopies As Integer
strInput = InputBox("Enter 1=for RICHO, Enter 2=for MINOLTA, 3=CANON")
If strInput > 0 Then
noOfCopies = InputBox("Enter # of Copies")
If noOfCopies > 0 Then
Set mobjWOrdApp = CreateObject("Word.Application")
mobjWOrdApp.Documents.Open conTEMPLATE_NAME
With mobjWOrdApp
.Visible = False
If strInput = 1 Then
.ActivePrinter = "\\PRNTRM\RICOH"
Forms!fPrintBacking!lblStatus.Caption = "-> Printing on RICOH \\ ->
" & noOfCopies & " Copies..."
ElseIf strInput = 2 Then
.ActivePrinter = "\\PRNTRM\MINOLTA"
Forms!fPrintBacking!lblStatus.Caption = "-> Printing on MINOLTA \\
-> " & noOfCopies & " Copies..."
ElseIf strInput = 3 Then
.ActivePrinter = "\\PRNTRM\Canon"
Forms!fPrintBacking!lblStatus.Caption = "-> Printing on CANON \\ ->
" & noOfCopies & " Copies..."
End If
DoEvents
.PrintOut Background:=False
.Documents.Application.PrintOut FileName:=conTEMPLATE_NAME,
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=noOfCopies
.ActiveDocument.Close False
.Quit
End With
End If
End If
Set mobjWOrdApp = Nothing
End Function