getfromclipboard

P

Peter

Hi,
Has anyone successfully used the getfromclipboard and
gettext calls in VBA within a Word Macro on the Mac? I
either get no text returned or an error.
Hope someone can help!!!
 
J

John McGhie [MVP - Word]

Peter:

No. The damn thing is not properly implemented. Use Paste and try to deal
with what you get. The real problem is that you cannot tell what is on the
clipboard from within VBA.

Cheers


from said:
Hi,
Has anyone successfully used the getfromclipboard and
gettext calls in VBA within a Word Macro on the Mac? I
either get no text returned or an error.
Hope someone can help!!!

--

Please respond only to the newsgroup to preserve the thread.

John McGhie, Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. GMT + 10 Hrs
+61 4 1209 1410, mailto:[email protected]
 
J

Jim Gordon MVP

Hi,

As John pointed out, the getfromclipboard feature is broken at the moment
and you can use paste methods to get content from the clipboard.

This problem was noticed and reported for Word version X, so there's a good
possibility that this will be fixed in Word 2004.

Word VBA won't tell you what kind of information is on the clipboard, but
Excel VBA will

ClipboardFormats Property Example
This example displays a message box if the Clipboard contains a rich-text
format (RTF) object. You can create an RTF object by copying text from a
Word document.
aFmts = Application.ClipboardFormats
For Each fmt In aFmts
If fmt = xlClipboardFormatRTF Then
MsgBox "Clipboard contains rich text"
End If
Next

So if you don't mind firing up Excel to see what's on the clipboard you
could actually do it via VBA.

-Jim
 
J

John McGhie [MVP - Word]

Hi Jim:

This responds to article <BCC9A3BA.A08C%[email protected]>,
Word VBA won't tell you what kind of information is on the clipboard, but
Excel VBA will

Ooooohhhh!!!! THAT is worth knowing. I am going to run straight away and
try this on the PC. Word VBA is broken there too, and this is such a
badly-needed function that it makes it worth calling an instance of Excel
just to find out what's on the damn clipboard!!!

Cheers


--

Please respond only to the newsgroup to preserve the thread.

John McGhie, Consultant Technical Writer,
McGhie Information Engineering Pty Ltd
Sydney, Australia. GMT + 10 Hrs
+61 4 1209 1410, mailto:[email protected]
 
J

Jim Gordon MVP

Hi John,

Before you run away to the PC give the GetFromClipboard method a go in Word
2004. You may be pleasantly surprised.

-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