InDesign.Document doc = (InDesign.Document)app.Open(PathToInDesignFile, true); // works fine
InDesign.Graphics allGraphics = (InDesign.Graphics)doc.AllGraphics; // crashes with an exception
That's the exception:
Unable to cast COM object of type 'System.__ComObject' to interface type 'InDesign.Graphics'.
This operation failed because the QueryInterface call on the COM component for the interface with IID '{C85A4AB§-9492-...}' failed due to the following error:
No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
How to solve this problem?