![]() |
#1
|
|||
|
|||
![]()
As stated in the title, I'm looking for a macro that combines every 5 sentences into a paragraph. Each sentence is separated by a paragraph break. For example:
Original article: This is the first sentence. This is the second sentence. This is the third sentence. This is the fourth sentence. This is the fifth sentence. New article: This is the first sentence. This is the second sentence. This is the third sentence. This is the fourth sentence. This is the fifth sentence. Help is greatly appreciated. Thanks in advance! |
#2
|
||||
|
||||
![]()
Hi jgarland,
If your article headings are in one paragraph Style and the text in another, or if there's, say, a double paragraph break between the text and the following article heading and only single paragraph breaks between the text paragraphs, this could all be done quite easily via Find/Replace, without the need for a macro. In any event, we'd need to know how many paragraph breaks exist between the text paragraphs and between them and the article paragraphs.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
I'm curious how you would do this using find/replace?
Also, I've attached an example doc of what I'm working with. There is no header. You'll see the article is broken down by sentence. I need every 5 sentences merged into a paragraph. Last edited by jgarland; 01-11-2012 at 09:48 AM. |
#4
|
||||
|
||||
![]()
Hi jgarland,
With the insertion point at the start of the document, try a wildcard Find/Replace, where: Find = ([!^13]{1,})^13([!^13]{1,})^13([!^13]{1,})^13([!^13]{1,})^13([!^13]{1,}^13) Replace = \1 \2 \3 \4 \5
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
That works like a charm on the example I uploaded, unfortunately it's not working with another file I need to apply this to as well. Do you know a way to join groups of sentences together, i.e. joined together by spintax, to form paragraphs? Attached you'll find another example.
And the reason I was looking for a macro was so I can quickly and easily run the macro and get it done in a couple clicks. |
#6
|
||||
|
||||
![]()
Hi jgarland,
For the spintax: Find = ([!^13]{1,})^13([!^13]{1,})^13([!^13]{1,})^13([!^13]{1,})^13([!^13]{1,})(^13) Replace = {\1 | \2 | \3 | \4 | \5}\6 Once the specifications are nailed (you didn't tell me about spintax before), this can easily be turned into a macro.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
Just tried the updated find/replace on what I sent you and it doesn't seem to be working. Any ideas?
|
#8
|
||||
|
||||
![]()
Hi jgarland,
It works fine for me on the original document (as posted, not after the previous Find/Replace). The second document already appears to be formatted with spintax, so I didn't assume you wanted anything further done to it.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
![]()
Sorry, I meant I need to apply the merge every 5 groups of sentences within curly brackets to make a paragraph, so I don't have to go through the article and manually merge the sentences groups together to form paragraphs.
Originally when I posted this I had thought that the same method to merge 5 sentences together into a paragraph would also apply to merging the curly bracket sentence groups together, but I was wrong. |
#10
|
||||
|
||||
![]()
Hi jgarland,
Do the intervening paragraphs have the spintax separators (ie '|')? Can you post a copy of a document showing how these paragraphs look before the merge?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
![]()
The groups of sentences are separated by a paragraph break. The example2.doc I uploaded in the previous reply is what I'm referring to.
|
#12
|
||||
|
||||
![]()
Hi jgarland,
That document already appears to be formatted the way you want it, so I don't understand the issue.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#13
|
|||
|
|||
![]()
Attached is what I'm looking to do.
The example shows the original article has 5 groups of sentences (the groups are defined by curly brackets). All I need is a simple way to merge the 5 groups of sentences together to essentially make one paragraph (as shown in the example under "needs to be"), so I don't have to manually go to the end of each group and do a "backspace" to remove the paragraph breaks thus merging the groups together. So that's why I'm looking for a macro to do this for every 5 groups of sentences. |
#14
|
||||
|
||||
![]()
Hi jgarland,
For that part, all you need is an ordinary Find/Replace, where: Find = ^p Replace = space character
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#15
|
|||
|
|||
![]()
Right, I know about that, but I need it to apply to every 5 groups. Let's say there are 20 groups of sentences in an article; I need to merge every 5 groups together, thus making 4 large groups of paragraphs.
|
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
aretai | Word | 5 | 07-17-2018 12:32 AM |
Exceptions for 'Capitalize first letter of sentences' | gazpacho | Word | 1 | 01-12-2012 11:43 AM |
![]() |
rajpes | Word | 4 | 02-25-2011 12:43 AM |
![]() |
Michael007 | Word VBA | 3 | 01-17-2011 04:11 PM |
capitalize first letter of sentences | norco1 | Word | 0 | 06-25-2006 12:37 PM |