![]() |
|
#1
|
||||
|
||||
![]()
For what you've described, that's as simple as:
Code:
Sub BulkFindReplace() Application.ScreenUpdating = False Dim FRDoc As Document, FRList, i As Long 'Load the strings from the reference doc into a text string to be used as an array. Set FRDoc = Documents.Open("Drive:\FilePath\FindReplaceList.doc", ReadOnly:=True, Addtorecentfiles:=False, Visible:=False) FRList = FRDoc.Range.Text FRDoc.Close False Set FRDoc = Nothing With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Text = "<desc></desc>" .Forward = True 'Process each entry from the source list. For i = 0 To UBound(Split(FRList, vbCr)) - 1 .Replacement.Text = Split(FRList, vbCr)(i) .Execute Replace:=wdReplaceOne Next End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Thanks Paul!
I will check that code ![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
amodiammmuneerk@glenmarkp | Word | 12 | 03-05-2018 03:31 AM |
![]() |
Robert Kay | Word VBA | 6 | 02-21-2018 04:41 PM |
![]() |
RPM7 | Word VBA | 6 | 05-12-2017 12:58 AM |
Macro code that prompts user to enter text, then does find/replace. | sfvegas | PowerPoint | 0 | 01-10-2016 08:02 PM |
Looking for code to create a macro that prompts user to enter text, then does a find/replace. | sfvegas | PowerPoint | 0 | 01-08-2016 02:22 AM |