This method returns a ReplicationClient object that can be used to replicate individual files.
Syntax
ReplicationProject.StartReplicationClient(Reserved)
Parameters
Reserved
This parameter is reserved for future use and should be set to zero.
Remarks
Note
You must define a project for the replication (using the ReplicationProject.Name property) before you call this method. If you have not defined a project before you call this method, Start fails, setting the error code CRS_ERROR_PROJECT_NOT_FOUND (15101).
You can only start a replication client on a local Content Deployment computer. This method fails if the previous ReplicationServer.Initialize method is called with the Server parameter set to the name of a remote Content Deployment computer.
Example
The following example starts a replication client on the new Latest project, copies a file, and deletes a file.
Option Explicit
On Error Resume Next
const CREATE_NEW_PROJECT = 1
dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")
dim ReplProject
set ReplProject = ReplServer.OpenProject("Latest", CREATE_NEW_PROJECT)
ReplProject.ReplicationMethod = "SENDINET"
ReplProject.Put("Destination", "http://www.mytestmachine.com/")
ReplProject.LocalDirectory = "C:\LocalCopy"
ReplProject.Flags = RF_EXCLUDE_AL
ReplProject.Flags = RF_FASTMODE
ReplProject.Commit
dim ReplClient
set ReplClient = ReplProject.StartReplicationClient(0)
ReplClient.SendFile("NewFile.htm")
ReplClient.DeleteFile("OldFile.htm")
'Release objects
set ReplClient = Nothing
set ReplProject = Nothing
set ReplServer = Nothing
See Also