要使用vba,比如打印第3页,大概
Dim str As String = "D:\问题\2022.doc"
Dim app As New MSWord.Application
Try
Dim doc = app.Documents.Open(str)
doc.PrintOut(From:=3,To:=3)
doc.close()
app.quit()
Catch ex As Exception
MsgBox(ex.Message)
app.quit()
End Try
Dim str As String = ProjectPath & "Reports\普工试卷.doc"
Dim app As New MSWord.Application
Try
Dim doc = app.Documents.Open(str)
doc.PrintOut(From:=3, To:=3)
doc.close()
app.quit()
Catch ex As Exception
MsgBox(ex.Message)
app.quit()
End Try
不可用,提示:RPC服务器不可用
[此贴子已经被作者于2024/1/12 16:51:13编辑过]
doc.PrintOut(From:=3, To:=3)改为
doc.PrintOut(From:="3", To:="3")