Clearing the clipboard

S

Shell

How do I in VBA code clear the clipboard so that when the document is closed
the message about clearing the clipboard is no longer shown.

Thanks
 
C

Cindy M.

Hi =?Utf-8?B?U2hlbGw=?=,
How do I in VBA code clear the clipboard so that when the document is closed
the message about clearing the clipboard is no longer shown.
You could select a single space (or word - just something small), then
Selection.Copy. You are talking about the message one gets when there's a large
object on the Clipboard, right?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
K

Karl E. Peterson

Shell said:
How do I in VBA code clear the clipboard so that when the document is
closed the message about clearing the clipboard is no longer shown.

For the sake of presenting all options...

Private Declare Function OpenClipboard Lib "user32" (ByVal hWnd As Long)
As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long

' Clear the clipboard of all content.
If OpenClipboard(0&) Then
Clear = CBool(EmptyClipboard)
Call CloseClipboard
End If
 

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