This method returns a ReplicationClient object that can be used to replicate individual files.
Syntax
ReplicationProject.StartReplicationClient(Reserved)
Parameters
Reserved
This property is reserved for future use and should be set to zero.
Remarks
You must create a project before you call this method. If you have not defined a project before you call this method, StartReplicationClient fails, setting the error code 0xC0003AFD (CRS_ERROR_PROJECT_NOT_FOUND).
If the project is already running, StartReplicationClient fails, setting the error code 0xC0003B0E (CRS_ERROR_PROJECT_ALREADY_RUNNING).
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