![]() |
|
#6
|
||||
|
||||
|
Quote:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long, StrNt As String
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "\(\[[!\(\[]@\][!\(]@\)"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Execute
End With
Do While .Find.Found
i = i + 1
StrNt = .Text
.Text = vbNullString
.Footnotes.Add .Duplicate, , StrNt
If i Mod 50 = 0 Then DoEvents
.Find.Execute
Loop
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Tags |
| regex, replace |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Using VB Regex feature, I tried to replace 'the' and 'this' with 'that' but got screwed
|
abdan | Word VBA | 3 | 01-18-2019 09:38 PM |
| How to compare 2 Excel sheets for 100+ matches? | dylansmith | Excel | 5 | 05-22-2017 09:09 PM |
| Macro help regex | subspace3 | Word VBA | 1 | 10-15-2014 09:53 AM |
Convert RegEx to Word (Devanagari Font Find/Replace)
|
gasyoun | Word VBA | 9 | 04-12-2013 04:15 PM |
| Regex in Word: Replaced strings are in disorder | chgeiselmann | Word | 0 | 04-26-2009 11:33 AM |