• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

Hi there,
I am trying to connect my C# apllication with the InDesign, but 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)).

 

I found this solution, Extracting InDesign CS4 Graphics using C# and COM  but I don't have any file tlb or the Scripting Support folder...

Does somebody knows how to solve this problem on InDesign 2020 COM with C#?

There is my code:

 

public void IndesignFile(){
   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[] { "" });
}

 

Could anybody help me, please?

 

TOPICS
Bug , How to , Scripting , SDK

Views

572

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 28, 2020 Aug 28, 2020

Launch InDesign as admin user, that forces creation of tlb file many times when its not already present

-Manan

Votes

Translate

Translate
Community Expert ,
Aug 28, 2020 Aug 28, 2020

Copy link to clipboard

Copied

Launch InDesign as admin user, that forces creation of tlb file many times when its not already present

-Manan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 31, 2020 Aug 31, 2020

Copy link to clipboard

Copied

LATEST

you can try this code:

 Type oType = Type.GetTypeFromProgID("InDesign.Application.2020");
dynamic myIndesign = Activator.CreateInstance(oType);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines