- 
                Notifications
    
You must be signed in to change notification settings  - Fork 57
 
Word
        Mark Humphreys edited this page Jan 29, 2017 
        ·
        2 revisions
      
    Word has a nice control hierarchy, and uses 'Pages' which are Custom controls.

AutomationWindow window = application.getWindow("Document1 - Word");
logger.info(window.name());
AutomationPanel pane = window.getPanel("Document1");
logger.info(pane.name());
logger.info(pane.getClassName());
AutomationPanel pane1 = pane.getPanel(0);
logger.info(pane1.name());
AutomationDocument doc = pane1.getDocument(0);
logger.info(doc.name());
AutomationDocumentPage page0 = doc.getPage(0);
logger.info(page0.name());
AutomationEditBox edit = page0.getEditBox(0);
logger.info(edit.name());
String text = edit.getText();
logger.info("Text = " + text.substring(0,10));