Previous Document Next Document

Object Model Reference : Classes : C : Clipboard : Methods : Clipboard.DataPresent


Clipboard.DataPresent

Function DataPresent(FormatName As String) As Boolean

Description

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.

Parameter
Description
FormatName
A string parameter that determines the presence of a particular data format in the Clipboard. It must be contained in quotation marks when passed to the function. "Text" is an example of a string parameter that can be passed as a FormatName parameter.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.