1 Reply Latest reply on Jan 21, 2015 8:36 PM by sreekarthik.k@gmail.com

    apply new style for existing paragraph

    Level 1

      How to apply new style for existing paragraph

       

      I need to apply existing paragraph style "FEBL1" to bullet list (newstyle)

        • 1. Re: apply new style for existing paragraph
          Sajeev Sridharan Level 4

          May be I am not clear with your question.

           

          You want to apply any style to a paragraph, you can use grep function:

           

          app.findGrepPreferences = app.changeGrepPreferences = null;         
          app.findGrepPreferences.findWhat = ".+";
          app.findGrepPreferences.appliedParagraphStyle = "FEBL1";    
          app.changeGrepPreferences.appliedParagraphStyle = "bullet list";    
          app.activeDocument.changeGrep();
          app.findGrepPreferences = app.changeGrepPreferences = null;  
          

           

          OR

           

          You want to add bullet list in your existing style "FEBL1", try the below code:

           

          var pstyles = app.activeDocument.paragraphStyles;  
          for(var i=0;i<pstyles.length;i++)  
          {  
              if(pstyles[i].name == "FEBL1")
              {
                  pstyles[i].bulletsAndNumberingListType = ListType.BULLET_LIST;
              }
          }  
          

           

           

          Vandy