Selection.Copy Method

Visio Automation Reference

Copies a selection to the Clipboard.

Version Information
 Version Added:  Visio 2002

Syntax

expression.Copy(Flags)

expression   A variable that represents a Selection object.

Parameters

Name Required/Optional Data Type Description
Flags Optional Variant Determines how shapes are translated during the copy operation.

Return Value
Nothing

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 Flags 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 use the value visCopyPasteNoTranslate to copy, you should also use that value to paste, because that 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.

See Also