wnd.accObj Property


object = wnd.accObj(objID, strClass, wndID);

If the necessary support is installed (see Accessibility) and if the application is an Accessibility server, then this property will return an object which allows greater control over the current UI element. Its interface depends on the objID specified. Note: you don't need to use this property if you only want an IAccessible interface: you can call accessibility methods and properties directly on any Q1 wrapper.

This property is useful for retrieving custom accessibility or native interfaces, such as those of MS Office applications. Here's an example of the types of objects returned by some applications when you specify consts.OBJID_NATIVEOM as the object ID:

Window classObject returned
_WwG (Word)Window
EXCEL7 (Excel)Window
paneClassDC (PowerPoint)DocumentWindow
MsoCommandBarCommandBar
RichEdit20WITextDocument

(Please refer to the appropriate documentation for the list of methods for the above objects.)

Example

// Obtain the native interface for a richedit
var document = app.accObj(consts.OBJID_NATIVEOM, "RichEdit20W");
document.Selection.Font.Bold = true;
document.Selection.Text = "This was done through an ITextDocument interface";
		

Parameters

objID
Optional. One of the consts.OBJID_x values or an application defined ID. Default value is consts.OBJID_WINDOW, returning the accessibility object for the current window. Please refer to the Accessibility SDK for more information.
strClass
Optional. String specifying the class of the window to search (see window classes constants). If it is not specified then wndID is ignored and the property will try to return the accessible object for the current window.
wndID
Optional. Either an integer as the zero-based index of the window of the specified class, or a string containing the window title. The string can be a regular expression. Default value is 0.

See also

wnd Overview | wnd.mshtml

 


© 2003 Lightweight Technologies. All rights reserved.