PDA

View Full Version : Carrying over the Textfield value to the web browser



sk_uc04
09-24-2007, 02:28 PM
Hello everybody,

I am trying to open a web browser for example www.google.com (http://www.google.com) and in the search field want to have the text/value of the textfield on my word document.

For eg:
On the word document, I have word "Yoga" entered in on of my text fields and when I press/enter Alt+F1, a web browser http://www.google.com opens. Now I want word "Yoga" entered in the google search text field.

Is there a way to carry the text field value in a session to take to web browser? I am kind of lost and not sure what to do about that.
Thanks everybody for the guidance and help.
Regards,
SK

OTWarrior
09-26-2007, 05:46 AM
I don't know of a specific VBA way of putting in a search option (as you would have to read the web page) but you could dynaically change the url address you go to based on what you type into the search on your document

for example

if search is blank then the output would be www.google.com (http://www.google.com)

but if your search is "yoga" then the output would be:
http://www.google.com/search?hl=en&q=yoga

if your search is "yoga classes" then it would be
http://www.google.com/search?hl=en&q=yoga+Classes

and the exclusive of that (search for sentence):
http://www.google.com/search?hl=en&q=%22yoga+Classes%22

The only output you would need to save would be:
http://www.google.com/search?hl=en&q=
and you add the search parameter to the end (make sure if there are spaces to turn them into +, and " into %22)

Hope that helps.