This method deletes a file on each destination server defined for the project, using the replication settings defined for the ReplicationClient object.
Syntax
ReplicationClient.DeleteFile(File)
Parameters
File
The file to delete. The file path should not include the full path (the path should only be relative to the project).
Remarks
You must have Site Server Publishing administrator privileges on the server to call this method.
If a connection is already established, this method deletes the remote file. If there is no connection to a destination server, this method connects, deletes the remote file, and then disconnects. If transaction processing is turned on at the destination servers, the destination servers do not delete the file until the Content Deployment replication server issues either a Commit method or a Disconnect method.
Example
The following example deletes the file Oldfile.htm on the Project1 destination servers.
Option Explicit
On Error Resume Next
dim Client
set Client = CreateObject("CrsApi.ReplicationClient")
Client.Initialize("Project1")
Client.DeleteFile("oldfile.htm")
'Release Client object
set Client = Nothing
See Also
ReplicationClient.SendFile, ReplicationClient.GetExtendedErrorInfo