View Single Post
 
Old 03-08-2016, 06:45 PM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Here is another adaptation. Notice this also addresses the issue of "., " tripping things up e.g., when you use e.g., in a sentence:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim strAbbr, i As Long
Dim oRng As Range
    strAbbr = ".Mr.Mrs.etc."
    With Selection
      Set oRng = Selection.Range
      .Collapse 0
      If .End <= .Sentences.First.End Then .MoveEnd wdSentence, 1
      Do While InStr(strAbbr, "." & Trim(.Words.Last.Previous.Words.First) & ".") > 0 Or Selection.Text = vbCr
        .MoveEnd wdSentence, 1
      Loop
      Do While Right(.Text, 3) = "., "
        .MoveEnd wdSentence, 1
      Loop
      oRng.End = .End
    End With
    Do While oRng.Characters.Last = vbCr Or oRng.Characters.Last = Chr(11)
      oRng.MoveEnd wdCharacter, -1
    Loop
    oRng.Select
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote