View Single Post
 
Old 07-11-2022, 09:06 PM
BrianHoard BrianHoard is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Jul 2022
Location: Haymarket, VA USA
Posts: 85
BrianHoard is on a distinguished road
Default How can I expand the range of an endnote with multiple paragraphs in the text?

I am working on my first VBA script which needs to copy the reference text of each endnote. I'm able to set a range for the endnote reference text fine except when the writer's have added multiple paragraphs. I am currently expanding my range to the end of the paragraph, however it only expands the end of the range to the first paragraph. Is it possible to expand the range to multiple paragraphs? Here's my code for getting the range now:
Code:
  rng_source.Expand Unit:=wdParagraph

Here's an example of a typical endnote. The # represents where the endnote superScript would be. Notice the writers put text (ABC) before the endnote number:
(ABC) #Some text paragraph1
Possible additional text paragraph2
paragraph3, etc.


(XYZ) #Next endnote. Could have only 1 or more paragraphs.
Reply With Quote