Clear clipboard

D

dziv

Does anyone know how to programmically clear the Word
clipboard? The following code I found on an MVP website
doesn't seem to work (and yes, the reference to the Office
2.0 Forms Library is checked):


Dim MyData As DataObject

Set MyData = New DataObject
MyData.SetText ""
MyData.PutInClipboard

Thanks so much.
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < dziv > écrivait :
In this message, < dziv > wrote:

|| Does anyone know how to programmically clear the Word
|| clipboard? The following code I found on an MVP website
|| doesn't seem to work (and yes, the reference to the Office
|| 2.0 Forms Library is checked):
||
||
|| Dim MyData As DataObject
||
|| Set MyData = New DataObject
|| MyData.SetText ""
|| MyData.PutInClipboard
||

This refers to the Windows clipboard, not the Office clipboard. I don't
think there is any way to control the Office clipboard through VBA yet.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
R

Ravi

Hi

Copy below code in VBA User form.

Dim MyDataObj As New DataObject
MyDataObj.SetText ""
MyDataObj.PutInClipboard

Because this procedure use the DataObject variable type,
so you must have a reference set in your VBA project to
the Microsoft Forms 2.0 object library

.......

Ravi
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < ziv > écrivait :
In this message, < ziv > wrote:

|| Can anyone answer my question? Please, please, please?
||

I believe I did.
There is no way to manipulate the Odffice clipboard.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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