DocCopyMoveEvent_PrepareCopy event

Occurs before a batch of documents are copied by various Meridian commands, but unlike other initialization events, it occurs for the current document in the batch.

Syntax

DocCopyMoveEvent_PrepareCopy (Batch, TargetFolder)
Parameters
Name Description

Batch

An object that represents the batch of documents the user has selected.

TargetFolder

An object that represents the destination folder. This event can modify the destination folder.

Example

The following example demonstrates how to assign a project copy to a known project folder (retrieved from a document property, for example) and how to suppress the Select Folder and Reference Explorer (for reference selection if references exist) dialog boxes.

Sub DocCopyMoveEvent_PrepareCopy(Batch, TargetFolder)
  If Not Document Is Nothing Then
    If Client.ImportType = AS_IT_COPIED And Client.ImportDetails = AS_ID_CREATEPROJCOPY Then
      'Add your code for document objects
      TargetFolder = "\Design\Projects\894" 'Or some property value
      'Suppress folder selection dialog
      Client.Confirmation(AS_CONFIRM_PROJECT_FOLDER) = False
      'Suppress reference selection dialog
      Client.Confirmation(AS_CONFIRM_SELECT_ASSEMBLY_ITEMS) = False
    End If
  ElseIf Not Folder Is Nothing Then
    'Add your code for folder objects
  End If
End Sub

Related concepts

About the document copy/move events