I am reviewing the long-standing best practice for Microsoft Word that warns against using ^13 in the "Replace with" box during Wildcard searches. Historically, sources like WordMVP have warned that ^13 inserts a "raw" carriage return that lacks paragraph properties and can corrupt document structure.
However, in my recent tests using Microsoft Word 2021 (and 365), the engine seems to behave differently than described in older documentation:
XML Inspection: After performing a Wildcard replace with
^13, I inspected thedocument.xml. Instead of a text-level carriage return, Word generated a validtag with a uniqueparaId.VBA Object Model:
ActiveDocument.Paragraphs.Countcorrectly identifies these lines as independent paragraph objects.Feature Support: Sorting, Styles, and Automatic Numbering seem to work perfectly on paragraphs created via
^13.
I am looking for:
Official Documentation/Links: Is there any updated technical information from Microsoft confirming an update to the Find/Replace engine that handles implicit conversion of ASCII 13 to a Paragraph Object?
Proof of Failure: Can anyone provide a specific scenario (via a macro or manual steps) where using
^13in a modern version of Word still produces "invalid" or "corrupt" results compared to^p?
Is the old warning still relevant, or has Word's architecture finally "healed" this legacy limitation?
---
I wrote a VBA macro to test this behavior. The macro first normalizes the document by replacing all marks with standard ^p. It then uses a Wildcard search to replace them with ^13.
Surprisingly, in Word 2021, the paragraph count remains identical, and the XML structure confirms that ^13 was converted into a proper object. This contradicts the traditional warning that ^13 creates "broken" paragraph marks.
Sub TestParagraphBehavior()
Dim OrgParaCount As Long
Dim NewParaCount As Long
Dim rng As Range
' Step 1: Normalize the document
' Replace all potential ^13 with proper ^p to ensure a clean start
Set rng = ActiveDocument.Content
With rng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^13"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = False ' Standard search
.Execute Replace:=wdReplaceAll
End With
' Step 2: Record initial paragraph count
OrgParaCount = ActiveDocument.Paragraphs.Count
' Step 3: Use Wildcards to replace existing paragraph marks with ^13
' We search for any character followed by a paragraph mark and replace it with ^13
Set rng = ActiveDocument.Content
With rng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "(?)(^13)"
.Replacement.Text = "\1^13"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchWildcards = True ' Wildcard search
.Execute Replace:=wdReplaceAll
End With
' Step 4: Record new paragraph count
NewParaCount = ActiveDocument.Paragraphs.Count
' Step 5: Report findings
MsgBox "Initial Paragraph Count: " & OrgParaCount & vbCrLf & _
"Post-Wildcard (^13) Count: " & NewParaCount & vbCrLf & _
"Status: " & IIf(OrgParaCount = NewParaCount, "Identical (Modern Behavior)", "Different (Legacy Bug)")
End Sub