The information in this article applies to:
SYMPTOMSWhen you run the following statement, to open the file "test.rtf", the following error message may appear: Or, if the file "test.doc" exists in the same folder as "test.rtf":
CAUSEIf a file extension is not specified when using the FileName argument, Word tries to open the file assuming a .doc extension, not by what is specified in the Format argument. The Format argument does not specify the file extension or type of file to open; instead, it specifies the file converter to use to open the file. In this example: "Format:= wdOpenFormatRTF"opens the file using the Rich Text Format (RTF) converter. WORKAROUNDSpecify the file name and extension when using the statement: Documents.Open FileName:= "test.rtf", Format:= wdOpenFormatRTF MORE INFORMATIONThe same problem arises when using: Application.Options.DefaultOpenFormat = wdOpenFormatRTF STATUSThis behavior is by design of Microsoft Word and Visual Basic for Applications. Additional query words: macro debug method vba vbe visual basic word97
Keywords : |
Last Reviewed: August 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |