Question
How to close and reopen a document immediately?
I would like to close a document and then immediately afterwards open it up again.<br /><br />The documentation says "To process a command to close the document immediately, use IDocumentCommands::Close'', but it also points to SDKLayoutHelper::CloseDocument which uses IDocFileHandler::Close.<br /><br />If I use IDocumentCommands::Close the close succeeds, but InDesign unexpectedly quits when it regains control.<br /><br />If I use IDocFileHandler::Close then when I reopen the document I get the assert ``Calling SelectionExtentionRegistry::Initialize more than once!'' This is the same error I get by not closing the document at all.<br /><br />I have also tried ProcessCommand(Utils<IDocumentCommands>()->CreateCloseCommand(docUIDRef)), but this also crashes InDesign when it regains control. <br /><br />In all cases I am calling ProcessCommand(CmdUtils::CreateCommand(kCloseLayoutWinCmdBoss), as otherwise I get an error that the document is still referenced on close.<br /><br />Is it possible to close all the layout windows and also close the document, so that it can be reopened immediately?