我的打印机名称是\\abc\First Floor A-Block
它的取名 \abc\First Floor A-Block on NE04:。我应该如何打印它
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 座:
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 文档?
谢谢