T
TazCoder
I have been writing a large macro and the final step is to find
multiple occurrences' of a specific character in one sentence. The
algorithm must:
Search every sentence in the word document, find any sentence that has
more then two (commas, or any other specific character), and highlight
the two of them.
I know the basic idea behind the algorithm and I know how to implement
it in C/C++/Java but not in VBA. I need to load each sentence
(searching for the period) into a string. In this string look for a
comma, remember the index and increment the counter by one, continue to
search for another comma. If another one is not found I am done, if
another one is found, mark that position, and highlight the two
positions.
The problem I have is with the actual coding. How can I go about doing
this?
How can I load each specific sentence into a string? (note the
sentences only end in periods, which makes is slightly less
complicated.)
How can I find the position of each comma within that string?
Once I have those two problems solved, the rest is easy.
Thanks.
multiple occurrences' of a specific character in one sentence. The
algorithm must:
Search every sentence in the word document, find any sentence that has
more then two (commas, or any other specific character), and highlight
the two of them.
I know the basic idea behind the algorithm and I know how to implement
it in C/C++/Java but not in VBA. I need to load each sentence
(searching for the period) into a string. In this string look for a
comma, remember the index and increment the counter by one, continue to
search for another comma. If another one is not found I am done, if
another one is found, mark that position, and highlight the two
positions.
The problem I have is with the actual coding. How can I go about doing
this?
How can I load each specific sentence into a string? (note the
sentences only end in periods, which makes is slightly less
complicated.)
How can I find the position of each comma within that string?
Once I have those two problems solved, the rest is easy.
Thanks.