R
Robin Tucker
Hi,
I would like to find the range of the first "item" (anything) after another
item (in this instance, a field code). Basically, I want to ignore
whitespace, carriage returns, page breaks etc. At present, I find the next
character after my field code like this:
theRange = MyDocument.Fields.Item(0).Result
theRange.End = theRange.End + 1
theRange.Collapse wdEnd
But the part of the document I'm interested in may be several carriage
returns or whitespaces or page breaks away. I notice that the units
enumeration in Word has "wdItem". However, when moving range with
theRange.Move, wdItem causes an error. So if my field code looks like this:
<<SECTION_START>>
------------------
- Here is a table -
------------------
<<SECTION_END>>
How should I go about setting the range to cover just the table? (assume
that there could be multiple carriage returns and/or spaces between
SECTION_START and the table.
Any tips would be greatly appreciated,
Robin
I would like to find the range of the first "item" (anything) after another
item (in this instance, a field code). Basically, I want to ignore
whitespace, carriage returns, page breaks etc. At present, I find the next
character after my field code like this:
theRange = MyDocument.Fields.Item(0).Result
theRange.End = theRange.End + 1
theRange.Collapse wdEnd
But the part of the document I'm interested in may be several carriage
returns or whitespaces or page breaks away. I notice that the units
enumeration in Word has "wdItem". However, when moving range with
theRange.Move, wdItem causes an error. So if my field code looks like this:
<<SECTION_START>>
------------------
- Here is a table -
------------------
<<SECTION_END>>
How should I go about setting the range to cover just the table? (assume
that there could be multiple carriage returns and/or spaces between
SECTION_START and the table.
Any tips would be greatly appreciated,
Robin