Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Server Developers
Viewing all articles
Browse latest Browse all 20709

InDesign server using VB Dot Net

$
0
0
Hi,

I need help regarding using InDesign server using Visual Basic .Net.
I tried to generate a new document in the following ways:

Dim IdApp As InDesign.Application
Dim Doc As InDesign.Document
Dim DocP As InDesign.DocumentPreset


IdApp = CreateObject("InDesignServer.Application.CS3")

' This is the command that appears in the documentation:
' Adobe Indesign CS Scripting guide, page 11
'Doc = IdApp.Documents.Add
' The Result:
' Compiles but generates the following run time error:
'An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
'Additional information: Invalid value for parameter 'DocumentPreset' of event 'Add'. Expected DocumentPreset, but received TRUE.
' In the following command I pass the parameters
' from the correct type in the correct order.
' The runtime result is as if the DocumentPreset
' parameter is the first and not the second
Doc = IdApp.Documents.Add(False, DocP)
' The Result:
'An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
'Additional information: Invalid value for parameter 'DocumentPreset' of event 'Add'. Expected DocumentPreset, but received FALSE.
' I tried passing the parameters in reverse order
Doc = IdApp.Documents.Add(DocP, False)
' Result
' Compile error:
' error BC30311: Value of type 'InDesign.DocumentPreset' cannot be converted to 'Boolean'.

Besides these methods, I saw at the InDesign Java documentation that in non-scripting languages, as Visual Basic
parameters cannot be omitted.
At Java, the class OptArg is provided in order to supply such parameters.
I couldn't find the corresponding class for Visual Basic.

Thanks in advance for your help,
C

Viewing all articles
Browse latest Browse all 20709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>