0 Replies Latest reply on Jul 23, 2009 10:11 AM by lorenzo.jorge

    VB CS4 - How send many textframe to a document to fill page and then another

    lorenzo.jorge

      Hi,

       

      Sorry by my bad english, I'm using CS4 and vbscript.

       

      Need to take information from several fields in a database and send it to an Indesign document. Progressively fill a page and then another.


      How do you add a textframe automatically for each field and the pages needed.

       

      With my current code, I can put a box on every page. But I want to put the text fields below and once you fill the page, switch to another.


      Thanks.

      Jorge

       

      Current code:

       

      For i As Integer = 0 To myDataSet.Tables(0).Rows.Count - 1

      myPage = myDocument.Pages.Item(i + 1)

      myTextFrame = myPage.TextFrames.Add

       

      Dim myArray1 As String() = {"4p", "4p", "60p", "20p"}

      myTextFrame.GeometricBounds = myArray1

      myTextFrame.Contents = myTextFrame.Contents + (myDataSet.Tables(0).Rows(i).Item(

      "name")).ToString + vbCr

      myTextFrame.Contents = myTextFrame.Contents + (myDataSet.Tables(0).Rows(i).Item(

      "adress")).ToString + vbCr

      myDocument.Pages.Add(idLocationOptions.idAfter, myDocument.Pages.Item(i + 1))

       

      Next