Hi,
I have a dialog that need a file from disk for correct work. At the moment I have a FileControl item on the dialog which user must click to select the needed file. How may I open the dialog for file selecting automaticaly without the need of user action?
Thanks in advance.
How to "click" on a FileControl element?
How to "click" on a FileControl element?
OpenOffice 3 / Windows 7
Re: How to "click" on a FileControl element?
So, you are using file control!
Try accessibility API to push the button inside the file control:This code is recorded by MRI extension, oInitialTarget is the dialog object. The accessible role of the button that you have to find in the list of accessible child is css.accessibility.AccessibleRole.PUSH_BUTTON (44).
Try accessibility API to push the button inside the file control:
Code: Select all
Sub Snippet(Optional oInitialTarget As Object)
Dim oControls As Variant
Dim oXControl As Variant
Dim oAccessibleContext As Variant
Dim oAccessibleChild As Variant
Dim oAccessibleContext2 As Variant
Dim nAccessibleRole As Integer
Dim oObj1 As Boolean
oControls = oInitialTarget.getControls()
oXControl = oControls(0)
oAccessibleContext = oXControl.getAccessibleContext()
oAccessibleChild = oAccessibleContext.getAccessibleChild(1)
oAccessibleContext2 = oAccessibleChild.getAccessibleContext()
nAccessibleRole = oAccessibleContext2.getAccessibleRole() ' should be PUSH_BUTTON
oObj1 = oAccessibleContext2.doAccessibleAction(0)
End Sub
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Apache OpenOffice 4-dev on Xubuntu 14.04