Hi all.
I'm currently having problems being able to select the text after finding it in a Word document. I'm running the code via Excel, and the following excerpt, for example, works fine:
(MyDoc is declared as Word.Document and is set via a WApp.Documents.Add procedure.)Please Login or Register to view this content.
However, I cannot manage to get the syntax correct to actually select the occurrence of the found string within the word document, so as to format it as I wish.
If I try, e.g.:
then this applies to the whole document, not just the selected text.Please Login or Register to view this content.
And if I try:
then the selection still applies to the active cell in the Excel sheet, not the Word document.Please Login or Register to view this content.
If it's important, then the lines immediately preceding these involve copying a section of text from the Excel document and pasting it into the Word document. The clipboard is not emptied.
Really appreciate any help, as always.
Cheers
Bookmarks