Forum Discussion

seanwindward's avatar
seanwindward
New Contributor
14 years ago

Selecting objects within word document body

The product I am testing is an addon to Microsoft Word, Powerpoint and Excel. I haven't found a way to add checkpoints or assertions to objects within the body such as text, tables, charts etc. The addon parses proprietary tags to deliver business reports. So ideally I would like to be able to select tags within the document body and assert certain behavior.

5 Replies

  • Hi,



    I recommend that you perform your validations via COM. All MS Office applications provide very convenient and deep access to their documents this way, so you should be able to check anything you want. To obtain a COM object, use the Sys.OleObject property (for example, to obtain Excel, use excel = Sys.OleObject("Excel.Application")).



    To find out which objects, properties and methods you should use to work with the target Office application, see its built-in VBA reference.
  • Okay so there is no way to select individual elements from within the word document body using the recording tool?
  • Hi,



    No, Word doesn't expose document elements as external objects.
  • Okay thank you



    Does your solution of using COM mean I should not use AutomatedQA or can I use AutomatedQA along with manually coded tests?



    Thanks
  • Hi,



    You need to manually write a script which will do this in TC.