'''
Dim dr As DataRow = e.DataRow
Dim file = e.SourceFolder & "\" & e.filename
If dr.IsNull("案号") Then
MessageBox.Show("案号不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
Else
Select Case e.DataCol.Name
Case "上传文件"
e.FileName = dr("案号") & ".doc"
End Select
End If
Select Case e.DataCol.Name
Case "上传文件"
Dim app As New MSWord.Application
try
Dim doc = app.Documents.Open(file)
Dim count = Doc.Characters.Count
Dim rng As MSWord.Range = Doc.Range(Start:=0, End:=count)
'msgbox(rng.Text)
Dim str As String = rng.text
'-----------------------
Dim ary() = str.replace(chr(10), "").split(new Char() {chr(13),chr(11)}) '清除段落空行
Dim ls As new List(Of String)
Dim i1 = -1
Dim i2 = -1
For Each s As String In ary
If s.trim() > "" Then
ls.add(s)
If s.Contains("被告报告你的单位名称") Then
i1 = ls.count-1
End If
If s.Contains("原告对被告出庭人员有无异议") Then
i2 = ls.count-1
End If
End If
Next
Dim nstr As String = ""
For i As Integer = i1 +1 To i2 -1 '显示开始-结束之间段落
nstr = nstr & ls(i) & vbcrlf
Next
msgbox(nstr)
e.DataRow("被告") = nstr
app.Quit
catch ex As exception
msgbox(ex.message)
app.Quit
End try
End Select