View Single Post
 
Old 01-19-2022, 10:25 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The code itself goes in the same module as the rest of your code.

The code is a function to be called from your main process. e.g. after say NextPara has been declared you can use it to check what the paragraph level number is.

To test it put the cursor in a paragraph and run the following macro from the same module as the function
Code:
Sub Test()
Dim para As Paragraph
    Set para = Selection.Paragraphs(1)
    MsgBox ListParaNum(para)
End Sub
You can use the number so obtained to determine what the next or previous paragraph is.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote