PasteSpecial method

Microsoft Visio Developer Reference

PasteSpecial method

See also   Example   

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 Word document).

Version added

2002

Syntax

object.PasteSpecial (format [,link][,displayAsIcon])

object

Required. An expression that returns a Master, Page, or Shape object.

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).

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 VisPasteSpecialFormat (see the following table).
  • Any value returned from a call to the RegisterClipboardFormat function. For details, see the Microsoft Platform SDK on the MSDN Web site.

Possible values for format declared by the Visio type library in VisPasteSpecialFormat are described in the following table.

Flag

Value

visPasteText

1

visPasteBitmap

2

visPasteMetafilePicture

3

visPasteOEMText

7

visPasteDeviceIndependentBitmap

8

visPasteEnhancedMetafile

14

visPasteOleObject

65536

visPasteRTF

65537

visPasteHyperlink

65538

visPasteURL

65539