![]() |
#2
|
||||
|
||||
![]()
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 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to find number of coma and then add that number of rows in word using macro? | PRA007 | Word VBA | 7 | 05-27-2015 10:45 PM |
![]() |
rahul4msoffice | Word | 1 | 05-01-2013 11:35 PM |
How place paragraph number in a text box? | peytontodd | Word | 2 | 12-13-2012 03:17 PM |
![]() |
peytontodd | Word | 2 | 12-11-2012 06:55 PM |
![]() |
SaneMan | Word VBA | 1 | 05-18-2011 05:43 AM |