How to solve 0x80004002 error on InDesign 2020 COM with C#?


Does anybody knows how to solve the same problem in InDesign 2020 and VS 2019? Extracting InDesign CS4 Graphics using C# and COM

I don't have any file tlb or the Scripting Support folder...

There is my code:

public void IndesignFile(){
    try {
          Type inDesignAppType = Type.GetTypeFromProgID("InDesign.Application.2020");
          InDesign.Application myInDesign (InDesign.Application)Activator.CreateInstance(inDesignAppType);
         var myString = myInDesign.DoScript("return \"My String\"", InDesign.idScriptLanguage.idJavascript, new object[] { "" });
            }catch(Exception e)

And I am getting this error:

Unable to cast COM object of type 'System.__ComObject' to interface type 'InDesign.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{ABD4CBB2-0CFE-11D1-801D-0060B03C02E4}' failed due to the following error: Não há suporte para esta interface (0x80004002 (E_NOINTERFACE)).

Could anybody help me, please?

asked on Stack Overflow Aug 28, 2020 by Giovanna Alves

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0