10 Replies Latest reply on Jun 8, 2009 8:20 AM by Set Screen name

    Is there more beautiful way to get reference for next para?

    Set Screen name

      I have insertion point in some paragraph.

      Now i need to know para style of some next paras.

      I use this huge construction:

       

      Set mPara0 = myInd.Selection.Item(1).Paragraphs.Item(1) 'para inder  cursor

      Set mPara3 = mPara0.InsertionPoints.Item(-1).Paragraphs.Item(1) 'third para
      Set mPara3 = mPara3.InsertionPoints.Item(-1).Paragraphs.Item(1)
      Set mPara5 = mPara3.InsertionPoints.Item(-1).Paragraphs.Item(1) 'fifth para
      Set mPara5 = mPara5.InsertionPoints.Item(-1).Paragraphs.Item(1)
      ParaName3 = mPara3.Paragraphs.Item(1).AppliedParagraphStyle.Name
      ParaName5 = mPara5.Paragraphs.Item(1).AppliedParagraphStyle.Name

       

      Is there some other way?

       

      Thanks.