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.
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.
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.