The information in this article applies to:
SUMMARYIn Microsoft Word, the WordBasic CopyFile command allows a specified file to be copied to another directory location. The syntax and function of this command are similar to those of the MS-DOS Copy command. MORE INFORMATIONWord for WindowsThe following macro copies the Test.doc file from the C:\Winword directory to the C:\Backup directory:
NOTE: If a file of the same name already exists in the target directory, a
message asking if you want to replace the existing file is displayed.
Syntax:
If a drive and directory are not specified in the Filename$ parameter, Word
for Windows copies the specified file from the current directory.
The Directory$ parameter for the CopyFile command should include the full path of the directory to which you want to copy the file. The following sample macro copies the active document file to drive B:
NOTE: The CopyFile command is not available in version 1.x of Word for
Windows.
NOTE: Information provided in this document is provided 'as is' without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. Word 6.x for the MacintoshFor Macintosh users the syntax for CopyFile is the same as above:
The .Directory parameter specifies the folder path to the file's location
or to where it is to be saved. For example "Macintosh HD:Desktop
Folder:Word Document"
The following macro will make a copy of the file named "Test" in the Microsoft Word 6 folder and save it to the desktop.
REFERENCES"Using WordBasic," by WexTech Systems and Microsoft, page 166 Additional query words: copy file macword
Keywords : kbmacro kbmacroexample winword word6 winword2 word7 word95 kbhowto |
Last Reviewed: October 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |