1 Reply Latest reply on Sep 28, 2009 3:21 AM by Kasyan Servetsky

    Search a paragraph style next to other paragraph style...

    Marcos Suárez Level 1

      I need search a paragraph style ("AAA") next to other paragraph style ("BBB"), and modifiy in this case ("BBB" to "BBB+")  with a "spaceBefore" of 3 mm...

       

      My code don't work...

       

      Please, help me...!!!

        • 1. Re: Search a paragraph style next to other paragraph style...
          Kasyan Servetsky Level 5

          Try something like this:

           

          for (i = 0; i < myFoundParagraphs.length; i++){
              try {
                  var myNextPar = myFoundParagraphs.nextItem(myFoundParagraphs[i]);
                  if (myFoundParagraphs[i].appliedParagraphStyle.name == "AAA" && myNextPar.appliedParagraphStyle.name == "BBB"){
                      myFoundParagraphs[i].spaceBefore = 3;
                  }
              }
              catch (myError){}             
          }

          1 person found this helpful