Replaces the existing document with a new Document in the existing document's window.
Syntax
object.ReplaceDocument(FileName)
Properties
The ReplaceDocument method syntax has these parts:
Part |
Description |
object |
An object expression that evaluates to an object in the Applies To list. |
FileName |
String. The name of the new document to open. |
Return Value
Object. The dispatch pointer to the new Document.
Remarks
If possible, always make this call the last line in your script. Note that when the ReplaceDocument method is used, and the document being replaced is the document that contains the script, the call must be the last line in the script. Otherwise, you may experience unexpected behavior when executing the script.
If the ReplaceDocument method is not called from the picture being replaced and is not the last line in your script, be certain that the operation is complete before the rest of the script continues to execute.