客户电脑没装msoffice,装的是wps,打印.doc文档时打印机没反应,什么原因,怎么处理?
Dim app As New MSWord.Application
try
Dim fileName = sc
Dim doc As Object = app.Documents.Open(fileName)
app.ActiveWindow.Selection.WholeStory
'StatusBar.ProgressBar.Visible =True
Do While app.ActiveWindow.Selection.Find.Execute("[分节符]") ''''''如果找到了,则自动将其选中
''''处理进度显示
StatusBar.ProgressBar.Value = rnum
If rnum <= fs - 1 Then
app.ActiveWindow.Selection.TypeText(Text:=" ") '''插入指定的文本.
Dim pBreak = MSWord.WdBreakType.wdSectionBreakNextPage '''枚举类型,分节符
app.ActiveWindow.Selection.InsertBreak(pBreak)
app.ActiveWindow.Selection.MoveRight(Unit:=1, Count:=2)
app.ActiveWindow.Selection.TypeBackspace
app.ActiveWindow.Selection.TypeBackspace
rnum = rnum + 1
Else
app.ActiveWindow.Selection.TypeBackspace
End If
Loop
For Each sect As Object In doc.Sections
With sect.Footers(1).PageNumbers
.RestartNumberingAtSection = True
.StartingNumber = 1
End With
Next
doc.save
StatusBar.Message1= fs & "份" & rptname & "正在打印中..."
app.Visible = False
doc.PrintOut()