PC Review


Reply
Thread Tools Rate Thread

Determine if clipboard is empty

 
 
XP
Guest
Posts: n/a
 
      28th Nov 2007
Using Office 2003 and Windows XP;

Is it possible using VBA to determine if there are any contents in the
clipboard?

If so, could someone please post a generic example of how to do this?

Thanks much in advance.
 
Reply With Quote
 
 
 
 
ilia
Guest
Posts: n/a
 
      28th Nov 2007
For text data, try this:

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

Public Function isClipboardEmpty() As Boolean
OpenClipboard (0&)
isClipboardEmpty = (GetClipboardData(1) = 0)
CloseClipboard
End Function



On Nov 28, 1:28 pm, XP <X...@discussions.microsoft.com> wrote:
> Using Office 2003 and Windows XP;
>
> Is it possible using VBA to determine if there are any contents in the
> clipboard?
>
> If so, could someone please post a generic example of how to do this?
>
> Thanks much in advance.


 
Reply With Quote
 
Dana DeLouis
Guest
Posts: n/a
 
      2nd Dec 2007
Just another option to test if the Clipboard is only holding an address
reference

Function LinkingModeQ() As Boolean
With Application
LinkingModeQ = .CutCopyMode = xlCopy Or .CutCopyMode = xlCut
End With
End Function

Sub Demo()
Range("A1").Copy
MsgBox LinkingModeQ

'// Windows: Linking mode compromised, therefore turned off
Application.CutCopyMode = False
MsgBox LinkingModeQ
End Sub

--
HTH
Dana DeLouis


"XP" <(E-Mail Removed)> wrote in message
news:AE8BF542-D0B2-412A-A17A-(E-Mail Removed)...
> Using Office 2003 and Windows XP;
>
> Is it possible using VBA to determine if there are any contents in the
> clipboard?
>
> If so, could someone please post a generic example of how to do this?
>
> Thanks much in advance.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clipboard empty but still get waring that clipboard is full Steve Microsoft Excel Misc 0 17th Jun 2008 09:05 PM
Clipboard empty but get cannot empty CB when trying to copy =?Utf-8?B?UGV0ZXIgQCBTZXJ2aWNlTWFzdGVy?= Microsoft Excel Worksheet Functions 0 22nd Feb 2007 03:58 PM
Clipboard gets empty by itself, cleared clipboard, copy paste doesn't work, outlook clears clipboard, problems with clipboard - possible solution Jens Hoerburger Microsoft Outlook 0 24th Aug 2006 02:44 PM
cannot clear clipboard when clipboard appears empty =?Utf-8?B?U2hhbmk=?= Microsoft Excel Misc 1 4th Nov 2004 02:58 AM
Clipboard - How to determine file is cut or copied ? Dinesh Jain Microsoft VB .NET 8 25th Sep 2003 10:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:49 PM.