Dave Punky
Board Regular
- Joined
- Jan 7, 2010
- Messages
- 133
Hi all,
I'm trying to use the Microsoft Web Browser additional control on a userform within Excel VBA but I'm having problems trying to find a string within the document.
Basically I have the page loaded within the web control, but what I want to do is search for a string and the 5 characters directly after it (and put this in a text box). Basically if I'm looking for the string "Number:" then I want that string returned and the 5 characters afterwards so it would read "Number: 1234" in my ajacent textbox once retrieved. Esentially it's searching the document on a page like Ctrl + F on a regular page, it's just getting the next few characters afterwards and making this a string.
I found a really useful guide (http://www.vbforums.com/showthread.php?t=384076) which explains the basics of searching strings and using the WebBrowser control generally but I'm having problems manipulating this to do what I want. Basically I can find the string and confirm it is on the document, but I can't actually pull the string out of the webpage/control. I know if this was just an Excel document it would be super easy using Left() or Mid() but I've not had much luck when doing this using said control.
Is there anyone out there who may be able to help?
I'm trying to use the Microsoft Web Browser additional control on a userform within Excel VBA but I'm having problems trying to find a string within the document.
Basically I have the page loaded within the web control, but what I want to do is search for a string and the 5 characters directly after it (and put this in a text box). Basically if I'm looking for the string "Number:" then I want that string returned and the 5 characters afterwards so it would read "Number: 1234" in my ajacent textbox once retrieved. Esentially it's searching the document on a page like Ctrl + F on a regular page, it's just getting the next few characters afterwards and making this a string.
I found a really useful guide (http://www.vbforums.com/showthread.php?t=384076) which explains the basics of searching strings and using the WebBrowser control generally but I'm having problems manipulating this to do what I want. Basically I can find the string and confirm it is on the document, but I can't actually pull the string out of the webpage/control. I know if this was just an Excel document it would be super easy using Left() or Mid() but I've not had much luck when doing this using said control.
Is there anyone out there who may be able to help?