Microsoft KB Archive/65157

FormatDefineStyles in Macro Gives “Cannot Open Document” Err

PSS ID Number: Q65157 Article last modified on 02-17-1993

1.00 1.10 1.10a WINDOWS

Summary: A “Cannot open document” error occurs in Word for Windows 1.0 when you create a macro that accesses a file within a valid subdirectory (with the same name as its parent) and then runs FormatDefineStyles. If from the File menu, you then choose New or Open, you receive the same error or the system hangs, requiring a cold boot.

More Information: To reproduce this problem, write the following macro and execute it from a new document: ChDir “c:” (where this directory exists) FormatDefineStyles .Name = “Normal” .BasedOn = &quot;&quot; .NextStyle = “Normal”  .AddToTemplate = 0 .NewName = &quot;&quot; .FileName = “NORMAL.DOT” .Source =1 .Merge FileNew .NewTemplate = 0 .Template = “NORMAL” Microsoft has confirmed this to be a problem in Word for Windows version 1.0. This problem was corrected in version 1.1.

Additional reference words: w4wmacro 1.00 1.10 1.10a