Dewayne_Pinion
10 years agoContributor
Clicking a button after finding WndCaption
Greetings, I am trying to write a routine to click any button within my AUT by calling the routine and passing it the button's WndCaption property. However, I am running into an issue, that the butt...
- 10 years ago
You can wildcard Test as ?T?e?s?t to account for possible hot-key ampersands in the string. Just be aware this may produce false positives.
sCaption = AddWildcards("Test")
Call ClickMyButton(sCaption)
...
' Adds ? before each character in a string, for example: ' Test -> ?T?e?s?t Function AddWildcards(Str) Dim re : Set re = New RegExp re.Pattern = "." re.Global = True AddWildcards = re.Replace(Str, "?$&") End Function