Copy method (Shape object)

Microsoft Visio Developer Reference

Copy method (Shape object)

   Example   

Copies a shape to the Clipboard.

Version added

2002

Syntax

object.Copy [flags]

object

Required. An expression that returns a Shape object.

flags

Optional Variant. Determines how shapes are translated during the copy operation.

Remarks

Possible values for flags are declared by the Visio type library in VisCutCopyPasteCodes, and are described in the following table.

Flag

Value

Description

visCopyPasteNormal

&H0

Default. Shapes are copied to the center of the document.

visCopyPasteNoTranslate

&H1

Shapes are copied to their original coordinate locations.

Setting flag to visCopyPasteNormal is the equivalent of the behavior in the user interface. You should use the visCopyPasteNormal and visCopyPasteNoTranslate flags consistently. For example, if you copy using visCopyPasteNoTranslate, you should also paste using that value as it is the only way to ensure that shapes are pasted to their original coordinate location.

To make a copy without using the Clipboard, use the Duplicate method.