Sleekmac
Registered User.
- Local time
- Today, 06:19
- Joined
- Sep 25, 2006
- Messages
- 34
Hi again all! I have a form in Access with an ActiveX WebBrowser control in it. What I want is for the user to select some text within the browser, and for that text to be captured in a string variable. I've been scouring the web all day for a clue as to how to do this, and this is all I could find:
The problem is, myText is all the text on the entire page. It seems that the ActiveElement is the entire page, even when text in the browser is selected. Does anyone know how I can isolate just the selected text please?
Code:
Private Sub test_Click()
Dim myText As String
Me.mainBrowser.SetFocus
myText = Me.mainBrowser.Document.activeelement.innertext
Debug.Print myText
End Sub
The problem is, myText is all the text on the entire page. It seems that the ActiveElement is the entire page, even when text in the browser is selected. Does anyone know how I can isolate just the selected text please?