Let's see the script and maybe we can figure out the problem...
Thanks you Harbs,
If the fact that I'm in VB (should have mentioned this before, sorry) is more of a hassle than it's worth for you I completely understand.
From everything I can tell while debugging everything has the value it needs and it WORKS perfectly as long as there are no prior sections in the document.
TheSprd is the spread the user is on, NextSprd is the spread following that, if there is one.
On NextSprd it turns off AllowShuffle and starts a new section with that same page number.
It then inserts a spread aftter TheSprd and makes the new spread start a section that is numbered for the page that precedes it with a and b (121a and 121b).
I initially had it inserting the spread, renumbering the new spread then renumbering the spread following the new spread but couldn't add the 2nd section. Hense the commented-out code at the bottom.
Dim Reslt$, PgsCount%, TheSprd As InDesign.Spread, TheSec As InDesign.Section, NextSprd As InDesign.Spread, PreFix$
Set IPage = Ind.ActiveWindow.ActivePage
Set TheSprd = IPage.Parent
If TheSprd.Pages.Count > 1 Then Set IPage = TheSprd.Pages(2)
If TheSprd.Index < IDoc.Spreads.Count Then 'set the next spread page number
Set NextSprd = IDoc.Spreads(TheSprd.Index + 1)
NextSprd.AllowPageShuffle = False
Set TheSec = IDoc.Sections.Add(NextSprd.Pages(1))
.ContinueNumbering = False
.PageNumberStart = CLng(IPage.Name) + 1
.SectionPrefix = ""
.IncludeSectionPrefix = False
NextSprd.AllowPageShuffle = True
PreFix$ = IPage.Name
Set TheSprd = IDoc.Spreads.Add(idAfter, TheSprd)
TheSprd.AllowPageShuffle = False
Set IPage = TheSprd.Pages(1)
Set TheSec = IDoc.Sections.Add(IPage)
.ContinueNumbering = False
.PageNumberStart = 1
.PageNumberStyle = idNumberingStyle.idLowerLetters
.SectionPrefix = PreFix$
.IncludeSectionPrefix = True
' If TheSprd.Index < IDoc.Spreads.Count Then
'' Set TheSprd = IDoc.Spreads(TheSprd.Index + 1)
''' Set IPage = TheSprd.Pages(1)
''' Set Ind.ActiveWindow.ActivePage = IPage
'' Set TheSec = IDoc.Sections.Add(TheSprd.Pages(1))
'' With TheSec
'' .ContinueNumbering = False
'' .PageNumberStart = CLng(PreFix$)
'' .PageNumberStyle = idNumberingStyle.idArabic
'' .SectionPrefix = ""
'' .IncludeSectionPrefix = False
'' End With
' End If
Well, took another look at this over the weekend and came up with nothing, zilch, nada, squat . . .
If someone had a moment to indulge me and post Java code for adding a section I might be able to determine whether it is a VB problem or a general problem.
Thanks again for any time spent.
Getting pretty desperate on this front.
Can I trouble someone to post the Java code for inserting a new section? I should be able to pick it apart enough to add variables and run it from VB to get what I need. I dying to know if the same things happens through Java. Not sure if it will matter, but desperate times call for desperate measure.
On a side note, what do Java nuts recommend for developing Java code? I currently use VB 6 which has great features like command completion (i.e. one types Application. and when you hit the period you get a list of options) and would like to find something that works similar.