View Single Post
 
Old 11-18-2023, 01:25 PM
Italophile Italophile is offline Windows 11 Office 2021
Expert
 
Join Date: Mar 2022
Posts: 554
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

The code examples in the documentation aren't always accurate.

In this one the Range object has been omitted. It should be:

Code:
Dim doc As Document, rngRange As Range
Set doc = ActiveDocument
Set rngRange = _
    doc.Range(doc.Paragraphs(1).Range.Start, _
    doc.Paragraphs(1).Range.End - 1)
rngRange.InsertAfter _
    " This is now the last sentence in paragraph one."
Reply With Quote