Clearing the Clipboard

  • Thread starter Thread starter Steven M. Britton
  • Start date Start date
Here's a prior post of nime ont his subject. Copy the sample code for
behind a CommandButton control into your Form's Close event.

From: Stephen Lebans ([email protected])
Subject: Re: Clearing Clipboard


View this article only
Newsgroups: microsoft.public.access.formscoding
Date: 2003-04-24 19:57:00 PST



Andy your solution will not work. You have to:
Open the CLipboard
Clear the Clipboard
Close the Clipboard


' Place these API declarations at the top of your Form in the General
Declarations area.
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



Private Sub cmdClip_Click()
On Error GoTo Err_cmdClip_Click

' Open, Empty and Close Clipboard
' No Clipboard API error handling
Call OpenClipboard(0&)
EmptyClipboard
CloseClipboard
MsgBox "ClipBoard Cleared!"


Exit_cmdClip_Click:
Exit Sub

Err_cmdClip_Click:
MsgBox Err.Description
Resume Exit_cmdClip_Click

End Sub


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top