Previous Document Next Document
Document.ApplyToDuplicate

Property ApplyToDuplicate As Boolean

Member of Document

The ApplyToDuplicate property lets you specify whether to create duplicates of objects while transforming them.

The ApplyToDuplicate property is used mainly for user interface compatibility and recording. Some commands may result in several duplicates and some may produce none. There is no way of referencing the duplicated shape; therefore, it is recommended that you use the Shape.Duplicate method to create duplicates of shapes. (This method works almost as quickly.)

It is important to note that the ApplyToDuplicate property affects the global state of the document. Changing this property may affect other script execution. You should always restore the state of ApplyToDuplicate after using it.

The following code example creates an ellipse and then moves it by one inch horizontally after creating a copy of it:

Sub Test() 
 Dim d As Document 
 Dim s As Shape 
 Dim b As Boolean 
 Set d = ActiveDocument 
 Set s = ActiveLayer.CreateEllipse2(4, 4, 2) 
 b = d.ApplyToDuplicate ' store previous state 
 d.ApplyToDuplicate = True 
 s.Move 1, 0 
 d.ApplyToDuplicate = b ' restore state 
End Sub 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.