Visio Guy

Visio Discussions => General Visio => Topic started by: harsha652 on August 04, 2014, 12:54:31 PM

Title: Copy paste of the shapes are not working
Post by: harsha652 on August 04, 2014, 12:54:31 PM
Hi,

Visio is getting hanged while performing the below operation.

currentShape.Copy (Visio.VisCutCopyPasteCodes.visCopyPasteNoTranslate)
newPage.Paste (Visio.VisCutCopyPasteCodes.visCopyPasteNoTranslate)
Title: Re: Copy paste of the shapes are not working
Post by: JuneTheSecond on August 06, 2014, 04:44:47 AM
No reply?

Your macro works.

Try next.


Option Explicit

Sub test()

Dim currentShape As Visio.Shape
Dim newPage As Visio.Page

Set currentShape = ActivePage.Shapes(1)
Set newPage = ActiveDocument.Pages.Add
currentShape.Copy (Visio.VisCutCopyPasteCodes.visCopyPasteNoTranslate)
newPage.Paste (Visio.VisCutCopyPasteCodes.visCopyPasteNoTranslate)

End Sub