![]() |
|
#1
|
|||
|
|||
![]() |
#2
|
|||
|
|||
![]() Quote:
Again the above macros work to find and replace normal text anywhere, but do not look for the text of field codes ex: {Seq Appendix \* Arabic}. Here the sample file you can try to explore what I mean. Last edited by laith93; 10-21-2021 at 09:25 PM. |
#3
|
|||
|
|||
![]() Quote:
Code:
Sub AppendixParens() ' Charles Kenyon using code from Graham Mayor ' October 21, 2021 ' https://www.msofficeforums.com/word/47835-putting-parentheses-around-sequence-number-caption-label.html Dim oStory As range, oFld as Field On Error Resume Next For Each oStory In ActiveDocument.StoryRanges Do For Each oFld In oStory.Fields If oFld.Type = wdFieldSequence Then If InStr(1, oFld.Code, "Appendix") > 0 Then oFld.Result.InsertAfter ")" oFld.Result.InsertBefore "(" End If End If Next oFld Loop Until oStory Is Nothing Next Set oFld = Nothing Set oStory = Nothing On Error GoTo -1 End Sub |
#4
|
|||
|
|||
![]()
Thank you again, Mr. Charles
I applied your code on my sample file, as it contains only two caption It takes about 15 mins without any changes until an error message appears "Not responding" 05.png My laptop RAM is almost full, and fan speed was increased, although I have a laptop with (CPU Intel Core i7, RAM 8GB, GPU 2GB). Any recommendation, please? |
![]() |
Tags |
find & replace, find replace;wildcards, word 19 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formula for number sequence | 14spar15 | Excel Programming | 4 | 03-18-2018 07:00 PM |
![]() |
Larry_1 | Excel Programming | 3 | 12-18-2017 06:59 AM |
![]() |
Jamal NUMAN | Word | 39 | 03-14-2017 06:32 PM |
![]() |
New Daddy | Word | 1 | 09-22-2013 09:21 AM |
Custom caption label annoyance | zac | Word | 1 | 08-29-2010 09:56 AM |