I used code in Greg Maxey post as a template in the
following. If there is nothing in the clipboard, it gives
a run time error at the line:
clipText = dObj.GetText
(Is there a way to capture the msgBox text -- its fairly long).
The whole reason for doing this function is to detect if
someone should have copied, but didn't -- so a paste
command wouldn't bomb with a cryptic error message
for non programmers.
Now it bombs with a different cryptic error message -- is
there a way to check that clipboard is empty so you can
quit gracefully?
Any help is much appreciated
' Pass the min Length that should be in clipboard in 'minTextSize'
' If actual clipboard size is less than that, return False, otherwise return
True
' Also return the actual clipboard text in 'clipText' for additional tests
' in calling code if needed
Function pastedEnough(minTextSize As Long, clipText As String) As Boolean
Dim dObj As DataObject
Set dObj = New DataObject
dObj.GetFromClipboard
clipText = dObj.GetText
If (Len(clipText) < minTextSize) Then
pastedEnough = False
Exit Function
End If
pastedEnough = True
End Function