Shape.PasteSpecial Method

Visio Automation Reference

Inserts the contents of the Clipboard, allowing you to control the format of the pasted information and (optionally) establish a link to the source file (for example, a Microsoft Office Word document).

Version Information
 Version Added:  Visio 2002

Syntax

expression.PasteSpecial(Format, Link, DisplayAsIcon)

expression   A variable that represents a Shape object.

Parameters

Name Required/Optional Data Type Description
Format Required Long The internal Clipboard format.
Link Optional Variant True to establish a link to the source of the pasted data; otherwise, False (the default). Ignored if the source data is not suitable for, or doesn't support, linking.
DisplayAsIcon Optional Variant True to display the pasted data as an icon; otherwise, False (the default).

Return Value
Nothing

Remarks

To simply paste the contents of the Clipboard into an object, use the Paste method.

The PasteSpecial method of a Shape object works only with Shape objects that are group shapes. Use the Type property of a shape to determine whether it is a group.

The value of the Format argument can be any of the following:

  • A value from VisPasteSpecialCodes (see the following table).
  • Any of the standard Clipboard formats, for example, CF_TEXT. For more information, see the Microsoft Platform SDK on MSDN, the Microsoft Developer Network Web site.
  • Any value returned from a call to the RegisterClipboardFormat function. For details, see the Microsoft Platform SDK on MSDN.
ms427191.vs_note(en-us,office.12).gif  Note
Before calling Microsoft Windows functions, you should understand how arguments and data types are handled by the Windows API DLLs. Incorrectly calling Windows functions may result in invalid page faults or other unexpected behaviors. For more information on calling Windows functions, search for "Windows API" on MSDN.

Possible values for Format declared by the Visio type library in VisPasteSpecialCodes are described in the following table.

Constant Value Description

visPasteBitmap

2

Paste bitmap.

visPasteDIB

8

Paste device-independent bitmap.

visPasteEMF

14

Paste enhanced metafile.

visPasteHyperlink

65538

Paste hyperlink.

visPasteInk

65544

Paste Ink data.

visPasteMetafile

3

Paste metafile.

visPasteOEMText

7

Paste OEM text.

visPasteOLEObject

65536

Paste OLE object.

visPasteRichText

65537

Paste rich text.

visPasteText

1

Paste ANSI text.

visPasteURL

65539

Paste Uniform Resource Locator (URL).

visPasteVisioIcon

65543

Paste Visio icon.

visPasteVisioMastersXML

65546

Paste Visio masters XML.

visPasteVisioMasters

65541

Paste Visio masters.

visPasteVisioShapesXML

65545

Paste Visio shapes XML.

visPasteVisioShapesWithoutDataLinks

65548

Paste Visio drawing data without internal data links.

visPasteVisioShapes

65540

Paste Visio shapes.

visPasteVisioText

65542

Paste Visio text.

See Also