There are other dictionary pages at this web page, but the word
validation is different and I need to validate against the scrabble box
Please can someone tell me how this is done
--
Mike
Please post replies to newsgroup to benefit others
Replace dead spam with ntl world to reply by email
This should work for you:
Public Function gbCheckScrabbleWord(rsWord) As Boolean
Dim ie As InternetExplorer
Dim sURL As String
Dim sHeader As String
Dim bytPostData() As Byte
Set ie = New InternetExplorer
ie.Visible = False
sURL =
"http://www.chambersharrap.co.uk/chambers/wwizards/wwizards.py/main"
bytPostData = "sword=" & rsWord & ""
bytPostData = StrConv(bytPostData, vbFromUnicode)
sHeader = "Content-Type: " & "application/x-www-form-urlencoded" &
vbCrLf
ie.Navigate sURL, 0, , bytPostData, sHeader
Do Until Not ie.Busy And ie.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
gbCheckScrabbleWord = InStr(1, ie.Document.body.innerhtml, "OSW ")
ie.Quit
Set ie = Nothing
End Function
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]
Can you please explain the difference between the Busy and the
ReadyState attribute - isn't testing for both overkill
I know the IE window opens in the background as invisible, but are there
any API's for going to viewing contents of URL's without needing IE
Mike wrote:
> Can you please explain the difference between the Busy and the
> ReadyState attribute - isn't testing for both overkill
I don't know for sure. All I can say is that in some cases, using 1 or the
other seems to fail on my machine unless I put in Application.Wait or Sleep
statements.
> I know the IE window opens in the background as invisible, but are
> there any API's for going to viewing contents of URL's without
> needing IE
You can use the MSXMLHTTP object:
Sub test()
Dim xml As XMLHTTP40
Set xml = New XMLHTTP40
xml.Open "POST", "http://www.chambersharrap.co.uk/" & _
"chambers/wwizards/wwizards.py/main"
xml.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
xml.send "sword=test"
Debug.Print xml.responseText
Set xml = Nothing
End Sub
It does seem much faster, but I don't know what it's doing behind the
scenes. I assume it's using the core libraries IE does without actually
instantiating the IE application. I don't think it will be installed on all
machines, so you may have to distribute the library for your users.
It needs a slight bit of tweaking in the middle before I check
responseText and I've had to use version 3.0 with Office 2000
It's just a problem with that CD (or something with Office on my hard
drive) as other software is fine
This would be a big help please
?READYSTATE_COMPLETE
4
?READYSTATE_INTERACTIVE
3
?READYSTATE_LOADED
2
?READYSTATE_LOADING
1
?READYSTATE_UNINITIALIZED
0
I forgot to mention in the previous posts, but if you add a reference to
Microsoft Internet Controls, these constants will be defined for you (as
well as the InternetExplorer class).
--
Regards,
Jake Marx
MS MVP - Excel
www.longhead.com
[please keep replies in the newsgroup - email address unmonitored]
>I forgot to mention in the previous posts, but if you add a reference to
>Microsoft Internet Controls, these constants will be defined for you (as
>well as the InternetExplorer class).
>
No worries - I'd worked that one out. Took a little longer to work out
what reference to include for the XML stuff though
<http://www.mattelscrabble.com/cgi-bin/chambers/scrabbleword.pl?action=ac
tion&word=anticonvulsive>