通过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文档?
谢谢
没有找到相关结果
已邀请:
1 个回复
田损比报
。 这应该有希望为您提供您需要发送的打印机名称的确切格式,以便Word识别它。