0 Replies Latest reply on Jul 7, 2011 5:47 AM by helbards

    [VB][CS5]How split text frame to two other frames.



      Function main()

          Set myInDesign = CreateObject("InDesign.Application")

          myInDesign.ScriptPreferences.UserInteractionLevel =         idUserInteractionLevels.idInteractWithAll

          If myInDesign.Documents.Count <> 0 Then

              If myInDesign.Selection.Count > 0 Then

                  Select Case TypeName(myInDesign.Selection.Item(1))

                      Case "TextFrame":

                          Set srcText = myInDesign.Selection.Item(1)

                          srcBounds = srcText.GeometricBounds

                          If srcText.Contents = "" Then

                              MsgBox ("X")

                              Exit Function

                          End IF

                          Set newText = srcText.Duplicate

                          newText.GeometricBounds = Array(srcBounds(0)         + 10, srcBounds(1), srcBounds(2) + 10, srcBounds(3))

                          srcText.GeometricBounds =         Array(srcBounds(0), srcBounds(1), srcBounds(0) + 10,         srcBounds(3))

                          Rem Belove lines do not work

                          Rem srcText.Texts.Item(2).Delete

                          Rem newText.Texts.Item(1).Delete

                      Case Else

                          MsgBox ("X")

                  End Select


                  MsgBox ("X")

              End IF


              MsgBox ("X")

          End If

      End Function



      So my problem is that InDesign dont see .Texts and its members. Why ??


      Message was edited by: helbards