以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 电脑没装msoffice,能用 MSWord.Application打印.doc文档吗? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=133249) |
-- 作者:wohenguaia -- 发布时间:2019/4/10 16:12:00 -- 电脑没装msoffice,能用 MSWord.Application打印.doc文档吗? 客户电脑没装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() |
-- 作者:有点甜 -- 发布时间:2019/4/10 17:41:00 -- 是程序死机还是没反应?
请尽量安装ms office,才能正常使用,不然,很多情况下都是冲突的。 |