2 Replies Latest reply on Jan 11, 2010 12:23 PM by Beliakov

    how to get into selection sequence of chars?

    Beliakov Level 1

      I have line of text like this:

      "qwerty (23) jhlkjhljkh"

       

      I need symbols before "(" marked as bold.

      "qwerty (23) jhlkjhljkh" (or some other formatting).

       

      i wrote this:

       

      Set myInd = mFunction.SetMyInd
      Set myDoc = myInd.ActiveDocument
      Set mySel = myInd.Selection(1)
      Set myM1 = mySel.ParentStory

       

       

      myInd.FindTextPreferences.FindWhat = "("
      Set mFounded = myM1.FindText()
      Set mPara = mFounded(1).Paragraphs(1)
      Set mChar = mFounded(1).Characters(1)
      Set myTextRange = mPara.Characters.ItemByRange(1, mChar)

           For i = 1 To myTextRange.Count - 1
                myTextRange(i).FontStyle = "Bold"
           Next

       

      Can i escape cycle and mark as bold needed symbols at once?

      In other words: can i get as selection all symbols before "("?