This article shows how to access Adobe
InDesign CS COM objects from .NET.
I needed to make an application that read product information from a database and inserted it in an Adobe
InDesign template to create a catalog ready for printing. There is not much information about this subject to be found on the Internet, so I thought I might share this article with you.
InDesign CS and the InDesign SDK need to be installed on the development computer.
Using the Code
Create a new project in Visual Studio and make a reference to COM object 'Adobe
InDesign CS Type Library'. The following code creates an instance of the
InDesign application and gets the first
textframe on the first page.
InDesign.Application app =
InDesign.Document doc = app.ActiveDocument;
InDesign.Page page = (InDesign.Page) doc.Pages;
InDesign.TextFrame frame = (InDesign.TextFrame) page.TextFrames;
frame.Contents = "Andere content";
To create an instance of the
InDesign COM object, I use the following code snippet:
public static object COMCreateObject (string sProgID)
Type oType = Type.GetTypeFromProgID (sProgID);
if (oType != null)
return Activator.CreateInstance( oType);
- 9th November, 2005: First publication