Problem with Access 2010 vba clipboard
After doing some research for your question, I have found the following:
Clear the clipboard in VBA:
Dim MyData As DataObject
Set MyData = New DataObject
MyData.SetText ""
MyData.PutInClipboard
Get text on clipboard into a string variable:
Dim MyData As DataObject
Dim strClip As String
Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
Get text from string variable onto clipboard:
Dim MyData As DataObject
Dim strClip As String
strClip = "Hi there"
Set MyData = New DataObject
MyData.SetText strClipÂ
MyData.PutInClipboard
The DataObject object is a part of the Forms library in VBA. Â In order for these codes to work, you would need to either Have at least one UserFormin your project, or in the VBA editor do the following:
go to Tools – References – and set a reference to the "Microsoft Forms 2.0 Object Library".