![]() |
|
|
|
#1
|
||||
|
||||
|
The macro doesn't remove an empty paragraph at the end of the document, but that's easily fixed
Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
'Graham Mayor - http://www.gmayor.com - Last updated - 25 Jun 2017
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = "^13{2;}" 'Note the list separator character - here ;
.Replacement.Text = "^p"
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
If Len(ActiveDocument.Range.Paragraphs.Last.Range) = 1 Then
ActiveDocument.Range.Paragraphs.Last.Range.Delete
End If
lbl_Exit:
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Help with replacing text with wildcards
|
sbatson5 | Word | 2 | 04-13-2012 03:49 AM |
| Why the "Text boundaries" are not shown till the end of the page while in other file | Jamal NUMAN | Word | 4 | 03-28-2012 07:58 AM |
outlook double spacing paragraphs
|
GWBDIRECT | Outlook | 3 | 04-06-2011 11:29 AM |
Replacing a single "l" with a double "ll"
|
MShroff | Word | 8 | 01-19-2011 08:43 AM |
| Replacing / editting text | LisaC | Word | 0 | 02-25-2010 03:40 AM |