1 Reply Latest reply on Jul 22, 2008 4:01 AM by (Marc_Boehler)

    [VB/CS3]  Setting Tabstops in Textframe

      Hi Folks,
      I got a simple problem I think. My Testscript creates a Textframe and Adds a Headline and Paragraphs to it. What I wanna do is simply set a Tabstop to each paragraph excluding the Headline.
      I searched the documentation and this forum but couldnt find anything about setting tabstops in VB. Would be nice if someone could help.

      Rem Creates a text frame in an example document,
      Rem enters text in the text frame.
      Rem
      Set myInDesign = CreateObject("InDesign.Application.CS3")
      Rem Make an example document.
      Set myDocument = myInDesign.Documents.Add
      Rem Set the measurement units to points.
      myDocument.ViewPreferences.HorizontalMeasurementUnits = idMeasurementUnits.idPoints
      myDocument.ViewPreferences.VerticalMeasurementUnits = idMeasurementUnits.idPoints
      Rem Create a text frame on page 1.
      Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
      myTextFrame.geometricBounds = Array(72, 72, 288, 288)
      myTextFrame.Contents = "Headline:" & vbCr
      Rem Writes 4 Paragraphs
      For i = 1 To 4
      myTextFrame.InsertionPoints.Item(-1).Contents = " Paragraph" & i & vbCr
      Next
        • 1. Re: [VB/CS3]  Setting Tabstops in Textframe
          Level 1
          OK, if found a solution for my Problem. Setting Tabstops was not a working idea. I set firstlineIndent and leftIndent and now i got what I wanted. If someone has the same Problem here is my Visual Basic Testscript:

          Rem Creates a text frame in an example document,
          Rem enters text in the text frame.
          Rem
          Set myInDesign = CreateObject("InDesign.Application.CS3")
          Rem Make an example document.
          Set myDocument = myInDesign.Documents.Add
          Rem Set the measurement units to points.
          myDocument.ViewPreferences.HorizontalMeasurementUnits = idMeasurementUnits.idMillimeters
          myDocument.ViewPreferences.VerticalMeasurementUnits = idMeasurementUnits.idMillimeters
          Rem Create a text frame on page 1.
          Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
          myTextFrame.geometricBounds = Array(10, 10, 120, 80)
          myTextFrame.Contents = "Headline:" & vbCr
          Rem Writes 4 Paragraphs
          For i = 1 To 3
          myTextFrame.InsertionPoints.Item(-1).Contents = "" & vbtab & "Paragraph" & i & " - Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat." & vbCr
          myTextFrame.ParentStory.leftIndent=4
          myTextFrame.ParentStory.firstlineindent=-4
          Next