D
dan8
Dear colleagues,
I develop MS Word Add-in , the goal is to perform specific search in Word
docment and then set cursor to found positions.
Range.Characters returns a collection of single- of double-byte characters.
The case of double-byte chars is e.g. document with a table. Table contains
some "D7" charatcers.
Characters is too slow way to access the whole document text, so I use
Range.Text. However, Text returns me a string of single-byte characters. D
and 7 are two separate characters , so Range.Text turns out to be longer
than Range.Characters.Count.
This becomes a problem , when I use Range.Move to set cursor to positions
found in Range.Text . Move uses the same way as Characters, i.e. D7 is single
character. So cursor position becomes incorrect.
I need at least one of the following :
- be able to get text as multibyte string, where two-byte character is one
character. Collecting text from Charatcers property does not work quickly
enough.
- be able to position (Move) cursor by bytes, not characters.
Thank you in advance for help !
I develop MS Word Add-in , the goal is to perform specific search in Word
docment and then set cursor to found positions.
Range.Characters returns a collection of single- of double-byte characters.
The case of double-byte chars is e.g. document with a table. Table contains
some "D7" charatcers.
Characters is too slow way to access the whole document text, so I use
Range.Text. However, Text returns me a string of single-byte characters. D
and 7 are two separate characters , so Range.Text turns out to be longer
than Range.Characters.Count.
This becomes a problem , when I use Range.Move to set cursor to positions
found in Range.Text . Move uses the same way as Characters, i.e. D7 is single
character. So cursor position becomes incorrect.
I need at least one of the following :
- be able to get text as multibyte string, where two-byte character is one
character. Collecting text from Charatcers property does not work quickly
enough.
- be able to position (Move) cursor by bytes, not characters.
Thank you in advance for help !