View Single Post
 
Old 05-14-2025, 07:55 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 302
vivka is on a distinguished road
Default

Hi, Shelley Lou! Although I didn't check it (because I don't have a text sample, only its picture), try this line:
Code:
If oRng.Characters(1).Start = oRng.Paragraphs(1).Range.Characters(1).Start Or oRng.Characters.First.Previous = "[" Then
This will be helpful if the string to find is not inside the paragraph.
Besides, I would insert

Code:
On Error Resume Next
at the beginning of the code to prevent error 91 popping up in case the range to find begins the active doc, because in that case the chr before the rng's 1st chr does not exist.
Reply With Quote