Dim dlg As New OpenFileDialog
dlg.Filter = "word模板|*.doc"
If dlg.ShowDialog =DialogResult.OK Then
Dim fl As String = dlg.FileName
Dim r As Row = Tables("部门管理.模板管理").AddNew()
r("模板名称") = FileSys.GetName(fl) '写入文件名
r.Save '必须先保存
FileSys.CopyFile(fl, ProjectPath & "Attachments/" & r("模板名称"))
End If
-----------
If Tables("部门管理.模板管理").Current Is Nothing Then
Return
End If
Dim dr As DataRow = Tables("部门管理.模板管理").Current.DataRow
Dim fl As String = ProjectPath & "Attachments/" & dr("模板名称")
Dim Proc As New Process '打开文件
Proc.File = fl
Proc.Start()