I want to write a script (C# or AutoIT or VBScript.. whatever works) which should
Get reference of already open outlook application
Iterate through ribbons to find a specific button
Execute that button click
How can I do it?
Use AutomationPeers.
Here is the MSDN article with lots of details: http://msdn.microsoft.com/en-us/library/ms752331.aspx
Add references to:
And here is a little C# code snippet of how to get the AutomationId of what currently has focus:
var id = AutomationElement.FocusedElement.Current.AutomationId;
this.txt.Text = id;
You can navigate the entire tree of a window and drive the entire UI using automation peers. This is how accessibility applications interact with applications in Windows. This is also one way that automated UI testing applications do it as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With