Hello everyone
I have been trying to search the contents of PDF which is displayed in webbrowser control, form has a text box pre populated with some text when it is clicked the focus is shifted to the webbrowser control and with some delay it opens find replace dialog box which is fine, and does copies the text in the box as well. Now the problem is, or rather I want it to search contents in PDF but apparently it doesn’t invoke the find option of PDF reader instead access find replace dialog box comes up which doesn’t seems to find phrase in pdf. Below is the code I have found from utter access website from Adezil
regards
I have been trying to search the contents of PDF which is displayed in webbrowser control, form has a text box pre populated with some text when it is clicked the focus is shifted to the webbrowser control and with some delay it opens find replace dialog box which is fine, and does copies the text in the box as well. Now the problem is, or rather I want it to search contents in PDF but apparently it doesn’t invoke the find option of PDF reader instead access find replace dialog box comes up which doesn’t seems to find phrase in pdf. Below is the code I have found from utter access website from Adezil
Code:
Private Sub txtFind_Click()
If IsNull(Me![ txtFind]) Then Exit Sub
Me.WebBrowser0.SetFocus 'Set Focus to the Web Browser Control (WebBrowser1)
SendKeys "^f", True 'CTRL+F will place Cursor in Find Box, in Browser (WAIT)
Sleep 3000
SendKeys Me![ txtFind], True 'Type in the Text in the Text Box txtFind on the Form (WAIT)
SendKeys "{ENTER}" 'Simulate pressing the ENTER Key
End Sub
Last edited: