0

I select X number of paragraphs in Word and want to activate a macro that performs the same action on each paragraph. The action is adding a style separator before the first period in each paragraph and then applying 2 styles, 1 before the period and one after.

I know how to write this code. However, I've spent hours trying various chunks of code to repeat this process on each of the selected paragraphs, with no luck.

I think the Selection.Paragraphs.Count may help me, in that it gives me the number of paragraphs selected, but I don't know how to incorporate it in my VBA to repeat my process X number of times, X being the number of paragraphs selected.

2
  • 1
    Welcome to Super User. We are not a script writing service. We expect users to tell us what they have tried so far (including the code they are using) and where they're stuck so that we can help with specific problems. Questions that only ask for code are too broad and are likely to be put on hold or closed. Please read How do I ask a good question?.
    – DavidPostill
    Sep 9, 2015 at 11:56
  • for each p in selection.paragraphs or for i=1 to selection.paragraphs.count ... selection.paragraphs(i) ... could help Sep 10, 2015 at 12:39

0

You must log in to answer this question.

Browse other questions tagged .