Reputation: 67
If I manually input Ctrl F, this triggers the box, so I'm hoping it's achievable via a button.
The below is the vbscript code I've tried using, similar to an excel VBA sub I've used in the past but it doesn't work.
Sub SubSearch
Set IE = CreateObject("InternetExplorer.Application")
IE.Dialogs(IEDialogFind).Show
End Sub
I've also tried using sendkeys "^F"
and this doesn't work either.
Upvotes: 2
Views: 336
Reputation: 16321
SendKeys
should work. Here's a simple HTA that uses SendKeys
to display the Find
dialog box:
<html>
<head>
<title>HTA Test</title>
<HTA:APPLICATION>
</head>
<body>
<button onclick="ShowFind()">Click me</button>
</body>
<script language="VBScript">
Sub ShowFind()
CreateObject("WScript.Shell").SendKeys "^f"
End Sub
</script>
</html>
Upvotes: 2