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?
Launch InDesign as admin user, that forces creation of tlb file many times when its not already present
-Manan
Copy link to clipboard
Copied
Launch InDesign as admin user, that forces creation of tlb file many times when its not already present
-Manan
Copy link to clipboard
Copied
you can try this code:
Type oType = Type.GetTypeFromProgID("InDesign.Application.2020");
dynamic myIndesign = Activator.CreateInstance(oType);