老师您好!
我的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
现在我不需要保护密码,就是要打开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
End try