FileCollection.CopyFile Method

This method copies a file from one index in the FileCollection to another. The contents of the file at the second index (destindex) are replaced by the contents of the file at the first index (srcindex).

Syntax

void CopyFile ( int srcindex , int destindex )

Parameters Description
srcindex The 0-based index of the source file name in the collection.
destindex The 0-based index of the destination file name in the collection.

Example

//This example adds three files to a FileCollection. It then replaces the contents of the third file
//with the contents of the first.
 
HotDocs_Online.FileCollection fc = new HotDocs_Online.FileCollection();
fc.Add("c:\\temp\\File1.docx");
fc.Add("c:\\temp\\File2.docx");
fc.Add("c:\\temp\\File3.docx");
fc.CopyFile(0, 2);