View Single Post
 
Old 11-18-2023, 11:00 PM
gmaxey gmaxey is offline Windows 10 Office 2019
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

You are right. The documentation is often wrong. The documentation on CustomXMLParts is deplorable. The documentation is not only often wrong. It is often more complex than in needs to be. In this case, I would have simply used:


Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  oRng.End = ActiveDocument.Range.Paragraphs(1).Range.End - 1
  oRng.InsertAfter " This is now the last sentence in paragraph 1"
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote