![]() |
|
#2
|
||||
|
||||
|
It might make more sense for the future to use automatic numbering so you won't have the problem with missed references, however
Code:
Sub Macro1()
Dim oRng As Range
Dim sText As String
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(findText:="\[[0-9]{1,}\]", _
MatchWildcards:=True, _
Wrap:=wdFindStop, _
Forward:=True) = True
Set oRng = Selection.Range
sText = sText & oRng.Text & Chr(32)
Loop
End With
ActiveDocument.Range.InsertAfter vbCr & sText
lbl_Exit:
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Userform to output specific text | ~clover | Word VBA | 2 | 06-01-2019 07:04 AM |
Content Control Listbox output to text box possible?
|
VGW | Word VBA | 2 | 07-05-2018 04:18 PM |
| Outlook Template: Trying to Output text and fields | back2ict | Outlook | 0 | 07-03-2018 08:57 AM |
| How do I output text to a specific cell (x,y)? | norwood | Word VBA | 2 | 01-31-2014 08:43 AM |
| Generating text output from PowerPoint picture/name slides | bornslippy | PowerPoint | 2 | 12-05-2013 11:04 AM |