Using clipboard contents in macro? 
Author Message
 Using clipboard contents in macro?

I copied the following from the MVP Using the Clipboard web page:

Dim MyData As DataObject
Dim strClip As String

Set MyData = New DataObject
MyData.GetFromClipboard
strClip = MyData.GetText

I want to use what I select and copy as the text to find in a macro.  When I
try to run this, though, the de{*filter*} says it doesn't know what DataObject
is - "User-defined type not defined".

Any suggestions?

Ed



Wed, 14 Dec 2005 05:03:25 GMT  
 Using clipboard contents in macro?
I found my answer.  A Google search pulled up the reference to the Forms 2.0
Object Library that was not checked.  Checking it solved the problem.  Well,
*THAT* one anyway ...

Ed


Quote:
> I copied the following from the MVP Using the Clipboard web page:

> Dim MyData As DataObject
> Dim strClip As String

> Set MyData = New DataObject
> MyData.GetFromClipboard
> strClip = MyData.GetText

> I want to use what I select and copy as the text to find in a macro.  When
I
> try to run this, though, the de{*filter*} says it doesn't know what DataObject
> is - "User-defined type not defined".

> Any suggestions?

> Ed



Wed, 14 Dec 2005 05:14:14 GMT  
 Using clipboard contents in macro?

Add a dummy userform to your VBE project. This, and a million other
bizzare gotchyas with Word's environments available from my books :-)


Quote:
>I copied the following from the MVP Using the Clipboard web page:

>Dim MyData As DataObject
>Dim strClip As String

>Set MyData = New DataObject
>MyData.GetFromClipboard
>strClip = MyData.GetText

>I want to use what I select and copy as the text to find in a macro.  When I
>try to run this, though, the de{*filter*} says it doesn't know what DataObject
>is - "User-defined type not defined".

>Any suggestions?

>Ed

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.

Products:   http://www.*-*-*.com/
Spellbooks: 728 pages of dump left and dropping...

The VBA Beginner's Spellbook: For all VBA users.



Thu, 15 Dec 2005 07:59:32 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to get Word VBA macro to pick up contents of clipboard (OT)

2. How to get Word VBA macro to pick up contents of clipboard

3. Copying DBGrid contents to clipboard (Or copying a table from a Data component to clipboard)

4. Help for getting rid of the contents in clipboard(office) using VBA

5. Using Clipboard Contents to Develop Filename and Save to Desktop

6. Using clipboard contents in FIND prompt.

7. Using code to examine macro contents

8. Updating content with a VBA macro using XML

9. Clipboard object questions... using the clipboard with vb4

10. How to copy contents of control to clipboard?

11. content of the clipboard

12. Clearing the Clipboard Contents

 

 
Powered by phpBB® Forum Software