S
subra
putInClipboard method of the DataObject is putting some invisible
characters on clipboard at the end of the string. I can see these
characters when i paste the clipboard conetents in BBedit. This
happens only on Mac (OSX). I don't have any problem on windows. I
figured out that for every character in the string one invisible
character is added at the end plus two ( if i have 10 character
string, there are 12 invisible characters). Also when I use GetText I
don't get anything. Following is my test code. I appreciate any
suggestions.
Dim data As DataObject
Dim text, rs As String
For i = 1 To 100 Step 1
text = text & "hello"
Next
Set data = New DataObject
data.SetText text
data.PutInClipboard
data.GetFromClipboard
rs = data.GetText
' no text in my immediate window
Debug.Print rs
characters on clipboard at the end of the string. I can see these
characters when i paste the clipboard conetents in BBedit. This
happens only on Mac (OSX). I don't have any problem on windows. I
figured out that for every character in the string one invisible
character is added at the end plus two ( if i have 10 character
string, there are 12 invisible characters). Also when I use GetText I
don't get anything. Following is my test code. I appreciate any
suggestions.
Dim data As DataObject
Dim text, rs As String
For i = 1 To 100 Step 1
text = text & "hello"
Next
Set data = New DataObject
data.SetText text
data.PutInClipboard
data.GetFromClipboard
rs = data.GetText
' no text in my immediate window
Debug.Print rs