打印word报表时我使用的代码如下:可以查看、复制、打印等,不可编辑,现在我需要的是不可编辑里的“字体颜色”这一功能可不可以可编辑状态,因为按日打印报表未打满页时前面部分涂改白色连续打印使用,请问如何实现?
Dim tm As String = ProjectPath & "Attachments\入院病历.doc" '指定模板文件
Dim fl As String = ProjectPath & "Reports\入院病历.doc" '指定目标文件
Dim wrt As New WordReport(Tables("住院记录"),tm,fl) '定义一个WordReport
wrt.Build() '逐行生成报表
wrt.quit
Dim app As New MSWord.Application
try
Dim fileName = fl
Dim doc = app.Documents.Open(fileName)
doc.Protect (Password:="123456", NoReset:=False, Type:= _
MsWord.WdProtectionType.wdAllowOnlyReading, UseIRM:=False, EnforceStyleLock:=False)
app.Documents.save
app.Visible = True
catch ex As exception
msgbox(ex.message)
app.Quit
finally
End try