Copy to clipboard

B

brotherescott

I am trying to use the code from the help file for "PutInClipboard" and
I get a error. Do I not have something loaded? It seems to have a
problem with the "DataObject" after New.


Sub Current_Path()
Set MyData = New DataObject
MyData.SetText ActiveDocument.Path
MyData.PutInClipboard
End Sub

The program is supposed to put the path of the active document into the
clipboard.

Word 2003 Win XP

Thanks
Scott
 
K

Klaus Linke

Hi Scott,

You need to add a reference to the Microsoft Forms Object Library.
If you add a user form to your project, that'll be done for you, and
the code should run.

Regards,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top