What is wrong with this code ? Thank you
(suggested to me by J.W. at this useful page :
http://www.word.mvps.org/FAQs/MacrosVBA/ManipulateClipboard.htm )

Type DataObject
Toto As Object
End Type
________________________
Sub MyTest()
Dim MyData As DataObject
Dim strClip As String
Set MyData = New DataObject (compiler error here : incorrect use of
the â??newâ?? keyword )
MyData.GetFromClipboard
strClip = MyData.GetText
MsgBox (strClip)
End Sub

RE: Using DataObject type for clipboard by CarolineJ

CarolineJ
Thu Jun 23 09:16:04 CDT 2005

Nothing is wrong with the procedure you just need to remove the TYPE
declaration at the top then it will work great!


"troubadour" wrote:

> What is wrong with this code ? Thank you
> (suggested to me by J.W. at this useful page :
> http://www.word.mvps.org/FAQs/MacrosVBA/ManipulateClipboard.htm )
>
> Type DataObject
> Toto As Object
> End Type
> ________________________
> Sub MyTest()
> Dim MyData As DataObject
> Dim strClip As String
> Set MyData = New DataObject (compiler error here : incorrect use of
> the â??newâ?? keyword )
> MyData.GetFromClipboard
> strClip = MyData.GetText
> MsgBox (strClip)
> End Sub
>