HiAspire
Technical User
- Oct 17, 2002
- 10
I'm trying to do something pretty simple but am getting an error. I just want to turn the contents of the clipboard into a string variable that I can use in my Word macro application. I found this sample code below in a few places but when I run it, I get an error: "Compile error: User-defined type not defined"
Sub ClipboardTest()
Dim MyData As DataObject
Dim strClip As String
Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
End Sub
I'm not sure if there is something else I need to turn on in the References, or if there is an easier way to accomplish this and avoid the error I am getting. Thanks!
Sub ClipboardTest()
Dim MyData As DataObject
Dim strClip As String
Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText
End Sub
I'm not sure if there is something else I need to turn on in the References, or if there is an easier way to accomplish this and avoid the error I am getting. Thanks!