我需要导入一批word文件中全文的文本,如何获取全文文本,再添加到foxtable?
For Each fl As String In FileSys.GetFiles("F:\EHS技术服务管理系统\表单\标准\GBZ 160.系列受控")
Dim dr As DataRow = DataTables("文本160").Find("文件名 = '" & fl & "'")
If dr Is Nothing AndAlso fl.Contains(".doc") Then
Dim app As New MSWord.Application
try
Dim wm As String = FileSys.GetName(fl)
dr = DataTables("文本160").AddNew()
dr("文件名") = fl
dr("标准号") = wm.SubString(0,wm.IndexOf("工作")).Replace("GBZT","GBZ/T")
dr("标准名称") = wm.SubString(wm.IndexOf("工作"),wm.IndexOf(".doc") - wm.IndexOf("工作"))
Dim doc = app.Documents.Open(fl)
dr("文本") = ?? ? 'word全文文本
doc.Close()
app.Quit
catch ex As exception
End try
End If
Next