Foxtable(狐表)用户栏目专家坐堂 → 复制EXCEL内有双引号问题


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

主题:复制EXCEL内有双引号问题

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


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

keydown事件,加上下面代码

 

If e.control = True AndAlso e.keycode = keys.v Then
    '执行代码
    Dim str As String = ClipBoard.GetText
    Dim nstr As String = ""
    Dim tempstr As String = ""
    Dim flag As Boolean = False
    For i As Integer = 0 To str.length - 1
        If str(i) = """" Then
            If i = 0 OrElse str(i-1) = chr(9) OrElse str(i-1) = chr(10) Then '开始
                flag = True
            ElseIf i = str.length-1 OrElse str(i+1) = chr(9) OrElse str(i+1) = chr(13) Then '结束
                tempstr = tempstr.Replace(chr(13), "")
                nstr &= tempstr
                tempstr = ""
                flag = False
            End If
        End If
        If flag = True Then
            tempstr &= str(i)
        Else
            nstr &= str(i)
        End If
    Next
    ClipBoard.SetText(nstr)
End If

 

 


 回到顶部