Page 1 of 1

How to get text from opened MS Word document ?

Posted: Thu Jul 17, 2014 12:04 pm
by ostap_osa
Hi,

I am trying to get text from the MS Word document which is opened.
Actually what I am doing:
1. Open MS Word and create new document
2. Type "some words" on the document page
3. Try to verify text "some words" exists on the page

I need something like .GetText/.Text attribute but it is not available for such container:
Assert.Equals(repo.WordApp.Document.GetText(), "some words")

I have tried to do it by image validation/comparison, but it is not stable solution.

Thanks in advance,
Ostap

Re: How to get text from opened MS Word document ?

Posted: Fri Jul 18, 2014 2:44 pm
by Support Team
Hi Ostap,

Have you already added the word process or the specific WordDoc class name to the GDI Capture List as described at the following page: Testing of Legacy Applications?
After you added it you should be able to track the text elements of a Word document.

Regards,
Markus