Foxtable(狐表)用户栏目专家坐堂 → [求助]startindex不能小于0


  共有3072人关注过本帖树形打印复制链接

主题:[求助]startindex不能小于0

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/26 9:25:00 [显示全部帖子]

'''
Dim dr As DataRow = e.DataRow
Dim file = e.SourceFolder & "\" & e.filename
Select Case e.DataCol.Name
    Case "上传文件"
        e.Subfolder = e.DataRow("承办人")  '将此文件存放在目录名为承办人名称的子目录中.
        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)
            Dim str As String = rng.text
            'For Each s As String In str
                'output.show(s & " " & Asc(s))
            'Next
            msgbox(str)
            '清除段落空行,得到一个不含空行的集合
            Dim idx = str.IndexOf("书  记  员")
            If idx < 0 Then idx = str.IndexOf("书 记 员".replace(" ", chr(-24159)))
            'msgbox(idx)                                   
            Dim idx2 = str.SubString(idx).indexof(Chr(13))
            'msgbox(idx2)
            If idx2 > -1 Then
                str = str.SubString(0, idx+idx2)
            End If
            Dim ary() = str.replace(chr(10), "").split(new Char() {chr(13),chr(11)})
            Dim lst As new List(Of String)
            For Each s As String In ary
                If s.trim() > ""  AndAlso s.contains("受理费") = False AndAlso s.contains("终审") = False AndAlso s.contains("不服") = False  Then
                    lst.add(s)
                End If
            Next
            app.Quit
        catch ex As exception
            msgbox(ex.message)
            app.Quit
        End try
End Select

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/26 12:33:00 [显示全部帖子]

'''
Dim dr As DataRow = e.DataRow
Dim file = e.SourceFolder & "\" & e.filename
Select Case e.DataCol.Name
    Case "上传文件"
        e.Subfolder = e.DataRow("承办人")  '将此文件存放在目录名为承办人名称的子目录中.
        Dim app As New MSWord.Application
        try
            Dim doc = app.Documents.Open(file)
            Dim count = Doc.Characters.Count
            app.ActiveWindow.Selection.WholeStory
            app.ActiveWindow.Selection.Copy
            'Dim rng As MSWord.Range = Doc.Range(Start:=0, End:=count)
            Dim str As String = ClipBoard.GetText
            ‘For Each s As String In str
            ’    output.show(s & " " & Asc(s))
            ‘Next
            'msgbox(str)
            '清除段落空行,得到一个不含空行的集合
            Dim idx = str.IndexOf("书  记  员")
            If idx < 0 Then idx = str.IndexOf("书 记 员".replace(" ", chr(-24159)))
            'msgbox(idx)
            Dim idx2 = str.SubString(idx).indexof(Chr(13))
            'msgbox(idx2)
            If idx2 > -1 Then
                str = str.SubString(0, idx+idx2)
            End If
            Dim ary() = str.replace(chr(10), "").split(new Char() {chr(13),chr(11)})
            Dim lst As new List(Of String)
            For Each s As String In ary
                If s.trim() > ""  AndAlso s.contains("受理费") = False AndAlso s.contains("终审") = False AndAlso s.contains("不服") = False  Then
                    lst.add(s)
                End If
            Next
            app.Quit
        catch ex As exception
            msgbox(ex.message)
            app.Quit
        End try
End Select

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/4/28 17:07:00 [显示全部帖子]

            Dim idx = str.IndexOf("书  记  员")
            If idx < 0 Then idx = str.IndexOf("书 记 员".replace(" ", chr(-24159)))

            If idx < 0 Then idx = str.IndexOf("代理书 记 员")


 回到顶部