🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #15164

C#: COMException when trying to start InDesign CS

#15164
From: Magnus_Strand
Date: Fri, 19 Dec 2003 10:12
25 lines
1560 bytes
Hi,

I am trying the C# code below to script InDesign CS.
When I already have InDesign CS running when I run the code it works fine, but when I try to start up InD CS automatically I get this msg:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CStest.exe

Additional information: COM object with CLSID {296CAEB5-C99C-4B3E-9359-6E7D6EAE71FC} is either not valid or not registered.

I am using Visual Studio .Net 2003 and I have added a reference
to InD CS typelib in the project.

Any help is appreciated.

--- code ---
InDesign.ApplicationClass a = new InDesign.ApplicationClass();
InDesign.DocumentPreset dp = a.DocumentPresets.Add();
InDesign.Document d = a.Documents.Add(true, dp);
System.Windows.Forms.MessageBox.Show("hi","test",
  System.Windows.Forms.MessageBoxButtons.OK,
  System.Windows.Forms.MessageBoxIcon.Error);
a.Quit(InDesign.idSaveOptions.idNo);

Regards,
Magnus Strand
Technical Details
Message-ID: <2ccf029f.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,69ead1e3d4913d77,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-12-19 02:37:32 PST
From: Magnus_Strand@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: C#: COMException when trying to start InDesign CS
Message-ID: <2ccf029f.-1@webx.la2eafNXanI>
Date: Fri, 19 Dec 2003 02:12:15 -0800
Lines: 28
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit