Click here to Skip to main content
15,902,299 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can I copy word file from one Path and past it to another selected path in C#

What I have tried:

copy word file from one Path and past it to another selected path in C#
Posted
Updated 20-May-20 1:07am

Try this:
C#
string inFile = @"D:\Test Data\MyFile.docx";
string outPath = @"C:\My Word Files";
string filename = Path.GetFileName(inFile);
string outFile = Path.Combine(outPath, filename);
File.Copy(inFile, outFile);
 
Share this answer
 
 
Share this answer
 
Comments
Maciej Los 20-May-20 6:58am    
5ed!
:D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900