![]() |
#4
|
|||
|
|||
![]()
Thanks for the response. I'm attaching a demo file with a function 'tetingRegEx'.
For the purposes of this test, I have simplified the regular expression to a simple text pattern, but the one I will be using is much more complicated. This doesn't affect the purpose of this test. Running the function should highlight every instance of 'Lorem' within the document. There are 2 fields (a 'CreateDate' field, and a text form field) after the second paragraph. In the paragraphs after these fields, the text highlighted is not the found text. I figured it was due to a discrepancy between the Field.code ( CREATEDATE \@ "M/d/yyyy" \* MERGEFORMAT ) vs Field.result (4/2/2018), but I don't see any correlation between those numbers. e.g. the date field code is 43 characters, the result is 8 characters. But it seems to offset the found range by 46 characters. If I could find out how to calculate the offset (46 for the date) from each field, then I could loop through all fields that preceed the found text and adjust the position. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
loes | Word | 3 | 09-04-2019 07:52 AM |
Word Regular Expressions: zero or more occurences? | tinfanide | Word | 6 | 09-16-2015 03:13 PM |
![]() |
tinfanide | Word VBA | 3 | 02-02-2013 10:07 PM |
regular expressions for empty lines | eNGiNe | Word | 1 | 01-21-2013 06:38 AM |
![]() |
tinfanide | Excel Programming | 4 | 05-30-2012 04:09 AM |