Object Model Reference : Classes : C : Clipboard : Methods : Clipboard.DataPresent |
Function DataPresent(FormatName As String) As Boolean
Member of Clipboard
The DataPresent method returns a True or False value that verifies the presence of a specific data format in the system Clipboard. The data format (for example, text or graphic) is determined by the Windows Clipboard Viewer utility. If you click the Display menu in the Viewer, all available data formats are available (and a check mark is displayed next to the active format). You may choose other formats to change the current view of the data in the Clipboard. The Clipboard may contain more than one data format at a time.
The following VBA example verifies the presence of text data in the Clipboard. It text data is present, the Clipboard is cleared of any data with the Clear method. If there is no text data in the Clipboard, a message displays in a message box.
Sub PresentData() |
If Clipboard.DataPresent("Text") Then |
Clipboard.Clear |
Else |
MsgBox "There is no text data in the Clipboard." |
End If |
End Sub
Copyright 2013 Corel Corporation. All rights reserved.