I have successfully created a js based datamerge using the soap example
I am now trying to do this programatically (e.g. directly interfacing with the server objects)
When you say "server objects" do you mean COM objects? Or do you mean InDesign DOM objects?
If JS works, then you probably have some kind of typing problem, which may or may not be your own. Obviously anything that crashes InDesign is a bug. You suggest you're using CS5.5 -- are you using the 7.5.1 update?
I would, however, get the JS and VB programs as close as possible to each other and start comparing them to see if you can find the source of the problem.
I seem to recall some people regenerating the TLB and even patching it because of type problems...
Oh, BTW, this post would be better off in the scripting forum, I think; honestly I didn't notice it wasn't there.... Or the InDesign Server forum that nobody reads -- oh hey, you've posted there!
Please be explicit about when you are posting the same question in two different places, and please link from one to the other. It makes it much easier to manage and reduces wasted effort.
Thanks for the reply!
I cross posted deliberately as no one had even read the entry in the server forum, you'll see that it is days older, mea culpa for not including the relevant link/hightlighting the cross post.
To answer your other questions
I am refering to Indesign COM objects; as you'll see from the code excerpt I have instantiated an app object (app = CreateObject("IndesignServer.Application")) successfully added a template file (doc = app.Open("C:/Adobe InDesign CS5.5 Server SDK/samples/sampleclient-aspnet-soap/files/template2.indd")) assigned the data merge data source (doc.DataMergeProperties.SelectDataSource(ds)) but it then falls down when the actual datamerge is called.
FYI, I have tried this in C#, vb.net and even classic ASP (vbscript) because of the typeing issues with c# and they all fall down at the same point.
I have a JSX version of this; this works fine if I pass it Indesign Server using SOAP (I am using the bundled sample soap script at the moment which is in Adobe InDesign CS5.5 Server SDK\samples\sampleclient-aspnet-soap), the datamerge works and the files are created fine.
I am using 7.5.1 (the trial was downloaded last week).
I am currently using the "lame" approach (call out using JS and the process the directory containing the files after Indesign has finished); but as the processed files have then to be associated with database records this is driving me mad.
Hope this expansion is helpful.
Well. I'm uncertain what to suggest. I have no idea what kind of presales support the ID Server team provides, but they're a low-volume product with high margins, so perhaps they will be able to go the extra mile.
I guess I would try hybridizing your code between VB and JS. You should be able to use the .toSpecifier() or .toSource() methods (at least in JS) to serialize your data references and pass them between VB and JS. That way you should be able to get a JS program that works fine except for one line that it calls to VB, which would be an excellent test case for the bug.
Alternatively, a VB program that calls the JS to do the guts of the work, but still has access to the resulting files so you can connect them up with your database records (that was a vit vague in your explanation).
But I really don't have any COM+ experience, so perhaps someone else will chime in. Maybe Peter, Bob, or Harbs can move this thread to the scripting forum to increase the chances of that. (A little inconvenient to recreate the whole thread there again...)
Oh, also: does it work in InDesign Desktop?