M
MT DOJ Help Desk
I have the following line in the Declarations of a module:
Dim cbValue As DataObject
When I try to run the macro, I get an error saying:
User defined type not defined.
I also have the following code in the macro:
' Trims any leading and trailing spaces from the clipboard value.
Set cbValue = New DataObject
cbValue.GetFromClipboard
cbLocate = Trim(cbValue.GetText)
cbValue.SetText cbLocate
cbValue.PutInClipboard
So I need to be able to move text to and from the clipboard. As I
understand it, I need a dataobject to do that. That same code in a form
works just fine. Does this mean that the way I have the macro written, it
will only work in a from? How do I make it work in a module?
--Tom
Dim cbValue As DataObject
When I try to run the macro, I get an error saying:
User defined type not defined.
I also have the following code in the macro:
' Trims any leading and trailing spaces from the clipboard value.
Set cbValue = New DataObject
cbValue.GetFromClipboard
cbLocate = Trim(cbValue.GetText)
cbValue.SetText cbLocate
cbValue.PutInClipboard
So I need to be able to move text to and from the clipboard. As I
understand it, I need a dataobject to do that. That same code in a form
works just fine. Does this mean that the way I have the macro written, it
will only work in a from? How do I make it work in a module?
--Tom