Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InDesign CS2: Scripting problems

Status
Not open for further replies.

parite

Programmer
Jul 24, 2006
1
ZA
Hi,

I have been assigned to change our VB.net application to work with InDesign CS2 scripting. Our previous version was working 100% with Indesign CS, but as expected, there were some changes in the scripting library for CS2.

The problem I'm having is in duplicating a Group that is selected.

Code:
Dim SelectedGroup As InDesign.Group
SelectedGroup = MyDocument.Selection.item(1)

Dim newgroup As InDesign.Group
newgroup = SelectedGroup.Duplicate()

As soon as the code reaches SelectedGroup.Duplicate(), the application bombs out telling me the following:

Run-time exception thrown : System.InvalidCastException - Return argument has an invalid type.

Apparently the Duplicate() function now accepts two arguments. I have passed it these two arguments, with the same result.

Any help would be GREATLY appreciated, as this is quite urgent for our company.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top