通过VB.net打印word文档中的活动打印机问题

我的打印机名称是
\abcFirst Floor A-Block
取名为 abc NE04上的第一层A-Block:我应该如何打印它
Private oWord As Word.Application

Dim lobjDoc As Word.Document

Dim strFolder as String
Dim pd As New PrintDocument
Dim strPrintername as String
oWord = CreateObject("Word.Application")
oWord.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone
oWord.ActivePrinter =strPrintername 
strFolder="D:testdoc.prn"
'我在这里给出网络上的打印机名称,但它的名字    abc NE04上的A-Block一楼:
lobjDoc = oWord.Documents.Open(CType(strFolder, Object))

lobjDoc.PageSetup.FirstPageTray = Word.WdPaperTray.wdPrinterAutomaticSheetFeed

lobjDoc.PageSetup.OtherPagesTray = Word.WdPaperTray.wdPrinterAutomaticSheetFeed

lobjDoc.PrintOut(Background:=False, Append:=False, OutputFileName:=strFolder, PrintToFile:=True)  'here its giving error about printer settings

lobjDoc.Close(SaveChanges:=False)
有没有办法通过PrintDocument打印包含所有内容的word文档? 谢谢     
已邀请:
你可以试试这个: 首先使用Windows打印机设置将该打印机设置为默认打印机。 然后手动打开Word并打开VBA编辑器,转到即时窗口并键入
?ActivePrinter
。 这应该有希望为您提供您需要发送的打印机名称的确切格式,以便Word识别它。     

要回复问题请先登录注册