Highlighted

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

New Here ,
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?

 

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

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

-Manan

TOPICS
Bug, How to, Scripting, SDK, Server developers

Views

74

Likes

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

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

New Here ,
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?

 

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

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

-Manan

TOPICS
Bug, How to, Scripting, SDK, Server developers

Views

75

Likes

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
Aug 28, 2020 0
Adobe Community Professional ,
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

Likes

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
Reply
Loading...
Aug 28, 2020 0
Enthusiast ,
Aug 31, 2020

Copy link to clipboard

Copied

you can try this code:

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

Likes

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
Reply
Loading...
Aug 31, 2020 0