#1
|
|||
|
|||
How do I add a missing full stop / period at the end of a paragraph?
Hi,
I sometimes have a document that has paragraphs of texts made of several sentences but the final full stop of each paragraph is missing. So it'll look like: Word word word word. Word word word word. Word word word word There is a full stop at the end of each sentence in the paragraph but not one at the end. I've tried doing a find replace for each letter plus the ^p character but it just puts an extra full stop at the end of every sentence so each paragraph ends up being: Word word word word.. Word word word word.. Word word word word How can I make the last character of a paragraph be a full stop (if it isn't a question mark or an ellipsis)? Thank you. |
#2
|
|||
|
|||
Forget the image below:
Use: Sub ScratchMacro() Dim oRng As Range Set oRng = ActiveDocument.Range With oRng.Find .Text = "[!.\!\?]" & Chr(13) .MatchWildcards = True While .Execute oRng.Select oRng.Start = oRng.Start + 1 oRng.InsertBefore "." oRng.Collapse wdCollapseEnd Wend End With End Sub |
#3
|
|||
|
|||
Ah, thank you! It was the ^p that was the problem with my code and your alternative of ^13 solved it for me, with some modification.
My VBA is now: .text = "([a-z,0-9])^13" .Replacement.text = "\1.^13" Many thanks again! :-) E2A: Just seen your amended answer. I'll make a note of that version too as I think it'll be a useful thing to remember for future problems. Thanks again, Greg. :-) |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to calculate the Average time period of a full oscilation on a set of data | DDK2110 | Excel | 2 | 05-27-2017 02:15 AM |
Office 365 OneDrive missing uploaded files during trial period | jgstanford | Office | 0 | 11-23-2014 08:33 AM |
Count the common time period (month) between two date period of time | Barni | Excel | 6 | 08-15-2014 07:52 AM |
how to replace a full paragraph with blanks? | dylansmith | Word | 8 | 10-22-2012 11:51 PM |
Paragraph border missing on interior paragraphs | strathglass | Word | 1 | 09-19-2011 02:41 PM |