Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

Clearing Clipboard with VBA Impossible?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Angie M. - 24 Jul 2007 20:30 GMT
Hello,

When searching for a way to clear the clipboard in Word 2003, we found
Jonathan West's suggestion of using
"CommandBars.FindControl(ID:=3634).Execute", however we can't get it to work
(maybe it works but we are missing a piece of the puzzle).  

Any suggestions or ideas?  We're ready to give up.  

Thanks for your time.
Doug Robbins - Word MVP - 24 Jul 2007 20:43 GMT
I am not sure from where you got that.  In Jonathon's article at
http://www.word.mvps.org/FAQs/MacrosVBA/ManipulateClipboard.htm, it states:

This is how to clear the clipboard in VBA:
Dim MyData As DataObject

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

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hello,
>
[quoted text clipped - 7 lines]
>
> Thanks for your time.
Sammy - 26 Jul 2007 00:20 GMT
Thanks, we just tried this.  It works with Word 97 but not Word 2003.  Any
ideas for clearing the clipboard in 2003?  

Thanks again

> I am not sure from where you got that.  In Jonathon's article at
> http://www.word.mvps.org/FAQs/MacrosVBA/ManipulateClipboard.htm, it states:
[quoted text clipped - 17 lines]
> >
> > Thanks for your time.
Karl E. Peterson - 26 Jul 2007 01:45 GMT
> Thanks, we just tried this.  It works with Word 97 but not Word 2003.  Any
> ideas for clearing the clipboard in 2003?

http://www.google.com/search?q=emptyclipboard+vba
Signature

.NET: It's About Trust!
http://vfred.mvps.org

old man - 26 Jul 2007 01:56 GMT
Hi,

I use this to clear the clipboard in Word 2003.

Add these three API declerations at the top of your module:
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As
Long

this routine will do it:
Sub ClearClipboard()
   
   OpenClipboard 0&
   EmptyClipboard
   CloseClipboard
 
end sub

What you may mean is that its very difficult to clear the Office Clipboard.

Old Man

> Thanks, we just tried this.  It works with Word 97 but not Word 2003.  Any
> ideas for clearing the clipboard in 2003?  
[quoted text clipped - 22 lines]
> > >
> > > Thanks for your time.
Sammy - 26 Jul 2007 18:12 GMT
THANK YOU ALL, YOUR TIME IS APPRECIATED

> Hi,
>
[quoted text clipped - 45 lines]
> > > >
> > > > Thanks for your time.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.