chroniclesofdave
New Member
- Joined
- Aug 8, 2016
- Messages
- 48
When i click a button i have it copy a string of text to my clip board, and it worked fine in windows 7, but i have seen some info around the internet that windows 10 has made that complicated and i have seen people say i need to use the API to copy text to consistently work in windows 10. For clarification, every now and again, i will click the button and the only thing i can copy is two squares of unknown text. The code i have been using is similar to this:
Any support would be great!
VBA Code:
Dim obj As New DataObject
Dim txt As String
'Put some text inside a string variable
txt = "Test Text"
'Make object's text equal above string variable
obj.SetText txt
'Place DataObject's text into the Clipboard
obj.PutInClipboard