Written by Allen Wyatt (last updated October 28, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365
FileCopy source, targetOf course, you need to provide the appropriate specifications for both the source and target designations. For instance, if you wanted to copy a file named MyFile.Doc from the current directory to the F: drive (perhaps where you have a thumb drive) you could do so:
FileCopy "myfile.docx", "f:myfile.docx"If you try to copy a file that is currently open (either by Word or through a different program), VBA generates an error.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (5915) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Copying a File in VBA.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Need to know if a number in a macro is odd or even? It's easy to figure out with the simple calculation shown in this tip.
Discover MoreWant to pull text from a bunch of paragraphs and stuff that text into comments? It's easy to do using the macro presented ...
Discover MoreIf you need to move the insertion point within your macro, then you'll want to note the HomeKey method, described in this ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments