Copy Method [Visio 2003 SDK Documentation]

Copies a text range or hyperlink to the Clipboard.

object**.Copy**

object     Required. An expression that returns a Characters or Hyperlink object.

Version added

2.0

Remarks

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

As it applies to the Selection and Shape objects.

Copies a selection or shape to the Clipboard.

object**.Copy** [flags]

object     Required. An expression that returns a Selection or Shape object.

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

Version added

2002

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.

Example

As it applies to the Shape object.

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.
                    
    vsoShape.Copy
 
 End Sub  

    

Applies to | Characters object | Hyperlink object | Selection object | Shape object

See Also | Cut method | Hyperlink object | Paste method