View Single Post
 
Old 12-09-2023, 02:44 AM
vivka vivka is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Jul 2023
Posts: 293
vivka is on a distinguished road
Default

Hi, RobiNew! I have three suggestions:
1) oRng.Collapse wdCollapseStart
can be replaced by
oRng.Collapse
because wdCollapseStart is the default value (a little shorter);
2) oRng.MoveEndUntil Cset:=" h"
will find any ONE char of the set of chars (either ' ' or 'h', not both of them) because Cset is a single-character function;
3) oRng.MoveUntil oRng Like "^# "
is incorrect. I'd use
oRng.MoveUntil Cset:="0123456789"
to find any digit.

These are just minor suggestions, maybe someone will help with the whole code because not everything in it is clear to me.
Reply With Quote