MartyConnelly
martyconnelly at shaw.ca
Wed Dec 6 14:59:38 CST 2006
It is not always wise to clobber a users clipboard and the newer WinXP clipboard has multiple pages and clipboard pages can be shared across computers. Given that caveat Or see for better memory control http://support.microsoft.com/?kbid=138909 ' 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 Sub Clip() 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 To view the clipboard while working with this. Sub clipview() 'http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q138/9/09.asp&NoWebContent=1 'http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q138/9/10.asp&NoWebContent=1 'for the ClipBoard viewer later. 'Acc How to Retrieve Information from the Clipboard (95/97) 'http://support.microsoft.com/default.aspx?scid=kb;EN-GB;q138910 'Perhaps the simplest way is to use DoCmd.RunCommand acPaste, 'which pastes the clipboard contents into the active control ' See if ClipBoard viewer exists 'No , there 's no Clipboard object (unless it was added in A2002 and I 'haven 't noticed it yet). Aside from the built-in RunCommand constants 'acCmdCopy, acCmdCut, acCmdPaste, acCmdPasteAppend, and 'acCmdPasteSpecial, if you want to manipulate the clipboard you can 'call the Clipboard API directly as demonstrated here: '"RunCommand acCmdCopy" will copy selected text and "RunCommand acCmdPaste" will paste it, both using 'the clipboard. Is this what you're looking for? ' http://www.mvps.org/access/api/api0049.htm 'mskb 138909 If Len(Dir("C:\WINDOWS\system32\clipbrd.exe")) > 0 Then 'Shell to open the Windows ClipBoard Viewer Shell "C:\WINDOWS\system32\clipbrd.exe", vbNormalFocus Else MsgBox "Image Copied to ClipBoard Successfully!", vbOKOnly, "Copy To ClipBoard" End If End Sub Bob Heygood wrote: >Hello to the list, >Thot I might try this one again. >After copying a record in form view, when closing the form, I get a message >that tells me I have copied a lot of data to the clipboard, do I want to >keep it available.... >Other than emptying the clipboard, can I suppress this message? >If not, do we have a favorite routine to clear the clipboard? > >TIA > >Bob Heygood > > > > -- Marty Connelly Victoria, B.C. Canada