The information in this article applies to:
SYMPTOMSIf your macro contains a FileOpen command to open a file with a long filename that contains spaces (for example, FileOpen .Name = "This is a long doc name.doc"), you receive the error message for each word within the quotation marks. This behavior also occurs when you are using a variable, as in the following example:
CAUSEWord interprets each word within the quotation marks as a single file and cannot find the files because they do not exist. You can specify multiple filenames inside the quotation marks to open several files at once. RESOLUTIONYou can modify the FileOpen command by adding the CHR$(34) to indicate the beginning and end of the long filename. This allows Word to interpret all of the text as a single filename. Using the above example, your command would appear as follows:
If the filename is contained in the variable A$, the correct FileOpen
command would be:
STATUSThis behavior is by design. Additional query words: ntword wordnt long file names nt word winword word6 6.0 macro wordbasic cannot find fileopen
Keywords : kbmacro |
Last Reviewed: December 30, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |