Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default How to pass text to web page ?

How to pass text to web page search box ?

How to Set obj = ie.Document.all.Item("???")

Option Explicit
Sub Testing_1()
Dim ie As InternetExplorer
Dim obj As Object
'~~ Prepare to open the web page
Set ie = New InternetExplorer
With ie
.Visible = True
.Navigate "http://www.yahoo.com/"
End With

'~~ loop until the page is fully loaded
With ie
Do Until Not .Busy
DoEvents
Loop
End With
Set obj = ie.Document.all.Item("searchlabel")
If Not obj Is Nothing Then
obj.Value = "Testing"
End If

Set ie = Nothing
MsgBox "Done"
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How to pass text to web page ?

As Tom indicated in your previous post, all this may be unnecessary if the
passing the criteria in the URL is supported.
If you perform a search on Yahoo for the words "Excel" and "help", you will
see that the URL you actually send to the Yahoo server is :
http://search.yahoo.com/search?ei=UT...l+help&x=0&y=0

So you can build that string yourself and .Navigate directly. Forget the
rest.

NickHK

"moonhk" wrote in message
ups.com...
How to pass text to web page search box ?

How to Set obj = ie.Document.all.Item("???")

Option Explicit
Sub Testing_1()
Dim ie As InternetExplorer
Dim obj As Object
'~~ Prepare to open the web page
Set ie = New InternetExplorer
With ie
.Visible = True
.Navigate "http://www.yahoo.com/"
End With

'~~ loop until the page is fully loaded
With ie
Do Until Not .Busy
DoEvents
Loop
End With
Set obj = ie.Document.all.Item("searchlabel")
If Not obj Is Nothing Then
obj.Value = "Testing"
End If

Set ie = Nothing
MsgBox "Done"
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default How to pass text to web page ?

Thank you,
Just understand Tom meaning. Just input the post string after then
url.

NickHK wrote:
As Tom indicated in your previous post, all this may be unnecessary if the
passing the criteria in the URL is supported.
If you perform a search on Yahoo for the words "Excel" and "help", you will
see that the URL you actually send to the Yahoo server is :
http://search.yahoo.com/search?ei=UT...l+help&x=0&y=0

So you can build that string yourself and .Navigate directly. Forget the
rest.

NickHK

"moonhk" wrote in message
ups.com...
How to pass text to web page search box ?

How to Set obj = ie.Document.all.Item("???")

Option Explicit
Sub Testing_1()
Dim ie As InternetExplorer
Dim obj As Object
'~~ Prepare to open the web page
Set ie = New InternetExplorer
With ie
.Visible = True
.Navigate "http://www.yahoo.com/"
End With

'~~ loop until the page is fully loaded
With ie
Do Until Not .Busy
DoEvents
Loop
End With
Set obj = ie.Document.all.Item("searchlabel")
If Not obj Is Nothing Then
obj.Value = "Testing"
End If

Set ie = Nothing
MsgBox "Done"
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default How to pass text to web page ?

Hi NickHK
Below is www.ibm.com, part of html
how to get/set value into name="q" ?


<form title="Search form" name="search-form" method="get"
action="http://www.ibm.com/Search/"
<table cellspacing="0" cellpadding="0" border="0"
<tr
<td width="1"<label for="q"<img alt="Search for:" height="1"
width="1" src="//www.ibm.com/i/c.gif" /</label</td
<td align="right"<input value="ERIC" type="text" size="15" name="q"
maxlength="100" id="q" class="input" /</td
<td width="7"&nbsp;<input type="hidden" name="v" value="14" /<input
type="hidden" name="lang" value="en" /<input type="hidden" name="cc"
value="us" /<input type="hidden" name="en" value="utf" /</td
<td<input value="Search" type="image"
src="//www.ibm.com/i/v14/t/us/en/search.gif" name="Search" alt="Search"
/</td
<td width="20"&nbsp;</td
</tr
</table
</form


NickHK wrote:
As Tom indicated in your previous post, all this may be unnecessary if the
passing the criteria in the URL is supported.
If you perform a search on Yahoo for the words "Excel" and "help", you will
see that the URL you actually send to the Yahoo server is :
http://search.yahoo.com/search?ei=UT...l+help&x=0&y=0

So you can build that string yourself and .Navigate directly. Forget the
rest.

NickHK

"moonhk" wrote in message
ups.com...
How to pass text to web page search box ?

How to Set obj = ie.Document.all.Item("???")

Option Explicit
Sub Testing_1()
Dim ie As InternetExplorer
Dim obj As Object
'~~ Prepare to open the web page
Set ie = New InternetExplorer
With ie
.Visible = True
.Navigate "http://www.yahoo.com/"
End With

'~~ loop until the page is fully loaded
With ie
Do Until Not .Busy
DoEvents
Loop
End With
Set obj = ie.Document.all.Item("searchlabel")
If Not obj Is Nothing Then
obj.Value = "Testing"
End If

Set ie = Nothing
MsgBox "Done"
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default How to pass text to web page ?

If you enter "some text" (without the ") in the search box and click Search,
you will see that the actual URL sent to the server is :
http://www.ibm.com/Search/?q=some+te...0 &Search.y=6

So build your own similar string and use that for the URL.

NickHK

"moonhk" wrote in message
ups.com...
Hi NickHK
Below is www.ibm.com, part of html
how to get/set value into name="q" ?


<form title="Search form" name="search-form" method="get"
action="http://www.ibm.com/Search/"
<table cellspacing="0" cellpadding="0" border="0"
<tr
<td width="1"<label for="q"<img alt="Search for:" height="1"
width="1" src="//www.ibm.com/i/c.gif" /</label</td
<td align="right"<input value="ERIC" type="text" size="15" name="q"
maxlength="100" id="q" class="input" /</td
<td width="7"&nbsp;<input type="hidden" name="v" value="14" /<input
type="hidden" name="lang" value="en" /<input type="hidden" name="cc"
value="us" /<input type="hidden" name="en" value="utf" /</td
<td<input value="Search" type="image"
src="//www.ibm.com/i/v14/t/us/en/search.gif" name="Search" alt="Search"
/</td
<td width="20"&nbsp;</td
</tr
</table
</form


NickHK wrote:
As Tom indicated in your previous post, all this may be unnecessary if

the
passing the criteria in the URL is supported.
If you perform a search on Yahoo for the words "Excel" and "help", you

will
see that the URL you actually send to the Yahoo server is :

http://search.yahoo.com/search?ei=UT...l+help&x=0&y=0

So you can build that string yourself and .Navigate directly. Forget the
rest.

NickHK

"moonhk" wrote in message
ups.com...
How to pass text to web page search box ?

How to Set obj = ie.Document.all.Item("???")

Option Explicit
Sub Testing_1()
Dim ie As InternetExplorer
Dim obj As Object
'~~ Prepare to open the web page
Set ie = New InternetExplorer
With ie
.Visible = True
.Navigate "http://www.yahoo.com/"
End With

'~~ loop until the page is fully loaded
With ie
Do Until Not .Busy
DoEvents
Loop
End With
Set obj = ie.Document.all.Item("searchlabel")
If Not obj Is Nothing Then
obj.Value = "Testing"
End If

Set ie = Nothing
MsgBox "Done"
End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphing Text: Pass or Fail Robert Charts and Charting in Excel 3 April 12th 09 11:41 PM
Want to dump text written on page 1 to page 2 in excel Moni Excel Worksheet Functions 3 November 2nd 07 07:01 PM
Pass text 255 char. to closed wkb with SQL? DB Excel Programming 1 December 9th 05 10:32 PM
Putting Page Number in last page text DRK Excel Programming 4 December 3rd 05 08:32 AM
How do I pass info from excel to a hyperlinked explorer page wcc[_4_] Excel Programming 1 July 23rd 05 04:15 AM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"