none
Clipboard Copy mixed data RRS feed

  • Question

  • Hi 

    I am coding a tools to get the Clipboard and save it for later use .

      If My.Computer.Clipboard.ContainsFileDropList Then
                If Not (ISRepeat(type_.FileDropList)) Then Exit Sub
                
                ClipBoardRet(ClipBoardRet.Count - 1).FileDropList = My.Computer.Clipboard.GetFileDropList()
                ClipBoardRet(ClipBoardRet.Count - 1).Type_ = type_.FileDropList
            End If
    
            If My.Computer.Clipboard.ContainsImage Then
                
                ClipBoardRet(ClipBoardRet.Count - 1).Image_ = My.Computer.Clipboard.GetImage
                ClipBoardRet(ClipBoardRet.Count - 1).Type_ = type_.Image_
            End If
    
            If My.Computer.Clipboard.ContainsText Then
                If Not (ISRepeat(type_.Text_)) Then Exit Sub
               
                ClipBoardRet(ClipBoardRet.Count - 1).Text_ = My.Computer.Clipboard.GetText()
                ClipBoardRet(ClipBoardRet.Count - 1).Type_ = type_.Text_
            End If

    the problem appear when I try to copy some data from Word or PowerPoint.

    it is mixed data of Pictures and text and sometimes tables with some Format.

    now when I use this to restore the clipboard 

    Dim index_ As Integer = LB_ClipBoard.SelectedIndex
            Select Case ClipBoardRet_x(index_).Type_
                Case type_.FileDropList
                    Clipboard.SetFileDropList(ClipBoardRet_x(index_).FileDropList)
                Case type_.Image_
                    Clipboard.SetImage(ClipBoardRet_x(index_).Image_)
                Case type_.Text_
                    Clipboard.SetText(ClipBoardRet_x(index_).Text_)
            End Select

    so when I paste the clipboard , I note that I lose :

    format

    lose data if it mixed ( pictures and text )

    Tables 

    So please anyone know the way to fix this.

    Thank in adv

    Wednesday, May 9, 2018 4:44 AM

All replies