Table of contents
Collapse the table of content
Expand the table of content

Shape.Copy Method (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Copies a shape to the Clipboard.


expression . Copy( Flags )

expression A variable that represents a Shape object.


NameRequired/OptionalData TypeDescription
FlagsOptionalVariantDetermines how shapes are translated during the copy operation.

Return Value



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

visCopyPasteNormal&;H0Follow default copying behavior.
visCopyPasteNoTranslate&;H1Copy shapes to their original coordinate locations.
visCopyPasteCenter&;H2Copy shapes to the center of the page.
visCopyPasteNoHealConnectors&;H4Do not clean up connectors attached to cut shapes.
visCopyPasteNoContainerMembers&;H8Do not cut and copy unselected members of containers or lists.
visCopyPasteNoAssociatedCallouts&;H16Do not cut and copy unselected callouts associated with shapes.
visCopyPasteDontAddToContainers&;H32Do not add pasted shapes to any underlying containers.
visCopyPasteNoCascade&;H64Do not offset shapes on copy.

Setting Flags to visCopyPasteNormal is the equivalent of the behavior in the user interface. You should use visCopyPasteNormal and the other 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.


The following example shows how to use the Copy method. It draws a rectangle and then copies it to the Clipboard.

Public Sub Copy_Example() 

 Dim vsoShape As Visio.Shape 

 Set vsoShape = ActivePage.DrawRectangle(1, 5, 5, 1) 

 'Copy the shape to the Clipboard. 

End Sub
© 2018 Microsoft