# 这个打印程式错在那里?

Posted by kkcheung on August 06, 1998 at 16:12:40:

prn_count = Printers.Count: l = 1
ReDim prn_name(prn_count)
For Each X In Printers
prn_name(l) = X.DeviceName
l = l + 1
Next
prnstr = "请选择以下列印机: " + Chr(13) + Chr(10)
For l = 1 To prn_count
prnstr = prnstr + Trim(Str(l)) + "--- " + Trim(prn_name(l)) + Chr(13) + Chr(10) + Chr(10)
strall = strall + Trim(Str(l))
Next l
res0 = InputBox(prnstr, "选择列印机", "1")
res0 = Trim(res0)
If InStr(strall, res0) <= 0 Or res0 = "" Then
MsgBox "选择列印机错误,系统将放弃本次列印."
Exit Sub
Else
prnorder = Val(res0) - 1
Set Printer = Printers(prnorder)
End If
MsgBox "请准备好打印机后,再按[确定]"
Printer.NewPage
Printer.EndDoc

上面的程式会将所有接上该电脑的打印机(包括纲络上的)列出供选择,
但每当选了其他的打印机,newpage还是在本机,即printer(0),为什么?
注:纲络上的打印机在其他软件是可正常打印的.

Follow Ups:

- Re: &#30786;□&#12468;□&#31064;Α&#23743;□e柑? Forrest 12:45:27 8/08/98 (2)
  - Re: &#30786;□&#12468;□&#31064;Α&#23743;□e柑? kkcheung 14:30:58 8/09/98 (0)
  - Re: &#30786;□&#12468;□&#31064;Α&#23743;□e柑? kkcheung 14:30:54 8/09/98 (0)