我打印时用如下方法打印:'**************************************************
dim doc as new Word.Document
dim strPrevPrinterName as string'将当前默认打印机先存起来
strPrevPrinterName  = doc.Application.ActivePrinter'将默认打印机改为我要用的打印机
doc.Application.ActivePrinter = strPrinterName'打印
doc.PrintOut'将默认打印机改为开始的默认打印机
doc.Application.ActivePrinter = strPrevPrinterName
'**************************************************
问题1) 
我不想在打印时通过这种直接修改默认打印机的方法打印.
doc.PrintOut 是否有设置打印机的方法/参数?还有其他解决方法吗?问题2) 
当执行doc.PrintOut时,只有打印机打印结束后,程序才能继续往下执行.这样太慢了.
可否有方法让打印机开始打印后,程序就能往下执行?(是不是有的打印机能实现此功能?)是否有其他能提升打印速度的方法?多谢!!!

解决方案 »

  1.   

    Application.ActivePrinter 不会影响系统的默认打印机,也就是说它只对当前Word Application生效至于打印速度问题,你可以设置成后台打印
    doc.PrintOut "Background:=True"
      

  2.   

    设置默认打印机:
    Private Sub Command2_Click()
    Dim X As Printer
    For Each X In Printers
       If X.PaperSize = vbPRPSA4 Then  '按纸张大小
       '或: If X.DriverName = "HP6L" Then   '按打印机名称
          '设定为系统缺省打印机。
          Set Printer = X
          ' 终止查找打印机。
          Exit For
       End If
    Next
    End Sub
      

  3.   

    to yas(新一代的矿工):1)我怎么觉得Application.ActivePrinter就是修改系统的默认打印机呢!
    打印word时(doc.PrintOut)就是用默认打印机打印。我是用调试的,应该不会错!2)多谢你的后台打印:)
    我是新手,了解得不多。
      

  4.   

    Application的默认打印机 和 系统的默认打印机是两回事吧
    PrintOut没有选择打印机的参数
      

  5.   

    我执行“doc.Application.ActivePrinter = strPrinterName”后系统的默认打印机就改变了啊!应该没错吧!
    是我的代码有问题?