View Single Post
 
Old 06-29-2015, 10:49 PM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
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 ofgmayor has much to be proud of
Default

You are probably going to have to do a bit of lateral thinking to grab this number from the autonumbered field in your document. The following macro should work for the paragraph at the cursor
Code:
Dim ofld As Field
Dim orng As Range
    Set ofld = Selection.Paragraphs(1).Range.Fields(1)
        ofld.Unlink
        Set orng = Selection.Paragraphs(1).Range.Previous
        orng.Collapse 0
        orng.MoveEndUntil Chr(9)
        orng.Select
        MsgBox orng.Text
        ActiveDocument.Undo
__________________
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