How to clear clipboard in ms word using VBA?

A

Ayush Jain

Hi Experts,

I need your help. Do you know how to clear the clipboard of MS Word
2003 through VBA Code?

If you have any idea, do let me know please.



I have tried this code : Application.CommandBars
("Clipboard").FindControl(ID:=3634).Execute

But it through an error.



Thanks.
 
A

Ayush Jain

Hi Experts,

I need your help. Do you know how to clear the clipboard of MS Word
2003 through VBA Code?

If you have any idea, do let me know please.

I have tried this code :  Application.CommandBars
("Clipboard").FindControl(ID:=3634).Execute

But it through an error.

Thanks.

Please help
 
C

Chip Pearson

Try

Application.CutCopyMode = False

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
D

Dave Peterson

Maybe you should ask in a forum dedicated to MSWord.

If you're trying to write something that runs from an Excel macro that automates
MSWord, you could post back with the results from the MSWord forum if you need
help writing that excel macro.
 
C

Chip Pearson

Try

Public Declare Function OpenClipboard Lib "user32" (ByVal hwnd As
Long) As Long
Public Declare Function EmptyClipboard Lib "user32" () As Long
Public Declare Function CloseClipboard Lib "user32" () As Long


Sub EmptyClip()
OpenClipboard (0&)
EmptyClipboard
CloseClipboard
End Sub


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

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