@dublove it is not about the approach @brian_p_dts took but about what are the possible approaches and there are not too many in this case. You need to locate the paragraphStyle to use it and there are two collections for that on the document object, namely
- paragraphStyles :- However, this does not contain styles that are present in the group. So you can't use this. This collection has the benefit of methods like itemByName, itemByID etc. So if you can use it this is the best method.
- allParagraphStyles :- This contains all the paragraph styles of the document irrespective of the group in which they are present. However, this is an array, so no special methods like itemByName. Only way to find anything in this would be iterating the array. Another point to note is that styles can have the same name inside different groups. So in order to exactly find the style in a particular group you will need to check it's group as well
So the approach that @brian_p_dts used is fine, else you can also try with allParagraphStyles. However, there is no straight method to get the styles in the group.
-Manan