Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2020, 09:42 AM
Helend269 Helend269 is offline How do I add a missing full stop / period at the end of a paragraph? Windows 7 32bit How do I add a missing full stop / period at the end of a paragraph? Office 2003
Novice
How do I add a missing full stop / period at the end of a paragraph?
 
Join Date: Aug 2017
Posts: 15
Helend269 is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 10-08-2020, 09:46 AM
gmaxey gmaxey is online now How do I add a missing full stop / period at the end of a paragraph? Windows 10 How do I add a missing full stop / period at the end of a paragraph? Office 2016
Word MVP 2003-2009
 
Join Date: May 2010
Location: Marble, NC
Posts: 1,102
gmaxey has a spectacular aura aboutgmaxey has a spectacular aura aboutgmaxey has a spectacular aura about
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 10-08-2020, 10:18 AM
Helend269 Helend269 is offline How do I add a missing full stop / period at the end of a paragraph? Windows 7 32bit How do I add a missing full stop / period at the end of a paragraph? Office 2003
Novice
How do I add a missing full stop / period at the end of a paragraph?
 
Join Date: Aug 2017
Posts: 15
Helend269 is on a distinguished road
Default

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. :-)
Reply With Quote
Reply

Thread Tools
Display Modes


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 do I add a missing full stop / period at the end of a paragraph? how to replace a full paragraph with blanks? dylansmith Word 8 10-22-2012 11:51 PM
How do I add a missing full stop / period at the end of a paragraph? Paragraph border missing on interior paragraphs strathglass Word 1 09-19-2011 02:41 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 02:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft