activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity activities

Last updated Mar 13, 2026

CopyFile

Copies a file to the specified destination folder in OneDrive or SharePoint.

Namespace: UiPath.MicrosoftOffice365.Activities.Api

Assembly: UiPath.MicrosoftOffice365.Activities.Api (in UiPath.MicrosoftOffice365.Activities.Api.dll)

Syntax

IFile CopyFile(
	IFile file,
	IFolder destination = null,
	string newName = null,
	ConflictBehavior conflictBehavior = ConflictBehavior.Fail
)
IFile CopyFile(
	IFile file,
	IFolder destination = null,
	string newName = null,
	ConflictBehavior conflictBehavior = ConflictBehavior.Fail
)

Parameters

file IFile : The file to copy.

destination IFolder (Optional) : The destination folder where to copy the specified file. If not specified, it defaults to OneDrive root folder.

newName String (Optional) : An optional name given to the copied file. If left blank, the copy retains the original name.

conflictBehavior ConflictBehavior (Optional) : What is the expected behavior when a file with the same name already exists in the destination folder.

Return value

IFile - The copied file.

  • Syntax
  • Parameters
  • Return value

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated