J
J
Hello everyone,
I need to implement efficient "line-walking" within Word.
Walking efficiently by paragraphs took a while to get right, but I was able
to: after a few trials, I found out that the best way was to use Range.Next()
with args (wdParagraph, 1), and use the returned range.
Using the story range's paragraphs was really slow, where it seems every
direct item access involved completely walking the range for every call. But
Range.Next(wdParagraph) fixed. it.
But no, for actual "visual" lines, this doesn't work. I'm using
Range.Goto(wdGoToLine, wdGotoRelative, 1), but it's still very slow.
Range.Next() ain't usable for lines.
Any suggestions for a fast way to walk all lines in a document?
BTW, the goal is the underlying layer on top of which to iimplement my
vi/vim emulator. It's already working, but it's pretty slow.
Thanks and best regards,
- Jon
I need to implement efficient "line-walking" within Word.
Walking efficiently by paragraphs took a while to get right, but I was able
to: after a few trials, I found out that the best way was to use Range.Next()
with args (wdParagraph, 1), and use the returned range.
Using the story range's paragraphs was really slow, where it seems every
direct item access involved completely walking the range for every call. But
Range.Next(wdParagraph) fixed. it.
But no, for actual "visual" lines, this doesn't work. I'm using
Range.Goto(wdGoToLine, wdGotoRelative, 1), but it's still very slow.
Range.Next() ain't usable for lines.
Any suggestions for a fast way to walk all lines in a document?
BTW, the goal is the underlying layer on top of which to iimplement my
vi/vim emulator. It's already working, but it's pretty slow.
Thanks and best regards,
- Jon