3 Replies Latest reply on Apr 22, 2008 9:42 AM by (Dmitry1776)

    How can i get a para properties?

      I'd like to center para in which i have table.

      I recognize the table by this:
      Set myTable = MyInd.Selection.Item(1).Parent.Parent 'get table by TXT-cursor in it.

      I tryed this:
      Set myParaW = MyInd.Selection.Item(1) 'word under cursor
      Set myParaP = MyInd.Selection.Item(1).Parent 'para under cursor
      Set myParaT = MyInd.Selection.Item(1).Parent.Parent 'table under cursor
      Set myParaPP = MyInd.Selection.Item(1).Parent.Parent.Parent 'smth more, but not needed para.

      So para is skipped. How to get it?

        • 1. Re: How can i get a para properties?
          Level 1

          Set myParaP = MyInd.Selection.Item(1).Parent 'para under cursor

          should be

          Set myParaP = MyInd.Selection.Item(1).characters.item(1).Paragraphs.Item(1)


          Set myParaP = MyInd.Selection.Item(1).characters.item(1).Paragraphs.Item(-1)

          give you last Paragraph in selection

          Set myParaP = MyInd.Selection.Item(1).characters.item(1).Paragraphs.Count

          give you number of selected paragraphs

          Set myParaP = MyInd.Selection.Item(1).characters.item(1).Words.Item(1)

          give you Word


          • 2. Re: How can i get a para properties?
            Level 1
            Well. Could you check more?
            1st. I had to add "parent" into your line (otherwise said "member of collection doesnt exist").

            Set myPara = MyInd.Selection.Item(1).Parent.Characters.Item(1).Paragraphs.Item(1)

            myPara.Texts.Item(1).Justification = idJustification.idCenterAlign
            myPara.Texts.Item(1).Justification = idJustification.idCenterAlign
            myPara.Texts.Item(1).FirstLineIndent = 0

            It affect only on para in cell, but not on para outside of table.
            So we didnt get parent para of table.

            P.S. I tried:
            Set myParaP = MyInd.Selection.Item(1).Parent.Paragraphs.Item(1)
            and get first para in story, but not parent para of table (again).

            • 3. Re: How can i get a para properties?
              Level 1
              Yes. They told me:

              b Set myPara = MyInd.Selection(1).Parent.Parent.StoryOffset.Paragraphs(1)


              Thanks anyway for sharing time for me.