Reading clipboard contents in Word Macro

W

Warrick

Hi,

Has anybody successfully been able to read the clipboard
contents using a word macro and calling getfromclipboard
and gettext on a Mac running Office X and Mac X 10.3?

The following code from Microsoft (kbid=212730) is meant
to do the trick but fails with a runtime error everytime!

Can somebody help please!!!!

Sub GetClipBoardText()
Dim MyData As DataObject
Set MyData = New DataObject
Dim sClipText As String
On Error GoTo NotText

' Get data from the clipboard.
MyData.GetFromClipboard

' Assign clipboard contents to string variable
sClipText.
sClipText = MyData.GetText(1)
MsgBox sClipText

NotText:

If Err <> 0 Then
MsgBox "Data on clipboard is not text."
End If

End Sub
 
J

Jim Gordon MVP

Hi,

If I were to tell you this bug was fixed in Office 2004 would you go out and
buy it and recommend it to all your friends?

-Jim
 

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