Returns data from a DataObject object in the form of a variant.
Syntax
object.GetData (format)
The GetData method syntax has these parts:
Part | Description |
object | Required. An object expression that evaluates to an object in the Applies To list. |
format | A constant or value that specifies the data format, as described in Settings. Parentheses must enclose the constant or value. If format is 0 or omitted, GetData automatically uses the appropriate format. |
Settings
The settings for format are:
Constant | Value | Description |
vbCFText | 1 | Text (.txt files) |
vbCFBitmap | 2 | Bitmap (.bmp files) |
vbCFMetafile | 3 | metafile (.wmf files) |
vbCFEMetafile | 14 | Enhanced metafile (.emf files) |
vbCFDIB | 8 | Device-independent bitmap (DIB) |
vbCFPalette | 9 | Color palette |
vbCFFiles | 15 | List of files |
vbCFRTF | -16639 | Rich text format (.rtf files) |
Remarks
These constants are listed in the Visual Basic (VB) object library in the Object Browser.
It's possible for the GetData and SetData methods to use data formats other than those listed in Settings, including user-defined formats registered with Windows via the RegisterClipboardFormat()
API function. However, there are a few caveats:
Note Not all applications support vbcfBitmap or vbCFPalette, so it is recommended that you use vbCFDIB whenever possible.