5
我的打印机名称为\\abc\First Floor A-Block
其取名为\ abc \ NE04上的一楼A块。我应该如何打印通过VB.net打印word文档中的活动打印机问题
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 \一楼A块上NE04:
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)
有没有什么办法通过打印word文档及其所有内容PrintDocument?
感谢