Using Internet Explorer to post data for a form inside word

7

75blured

Hello,

I'd like in a button in a Word 2000 document to submit data by posting
an http request and catch the error which could happen (404 / 501
etc...)

As I'm using NTLM authentification I need to use InternetExplorer
object.

So the idea is to do that kind of code :
<<
Private Sub CreateDocButton_Click()
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "about:blank"
IE.Visible = False
Dim PostData() As Byte
PostData = StrConv("<pouet>", vbUnicode)
IE.Navigate "http://www.pouet.com/" & "document", Null, Null,
PostData, Null

End Sub

Private Sub IE_NavigateError( _
pDisp, _
URL, _
TargetFrameName, _
StatusCode, _
Cancel)

MsgBox ("pDisp : " & pDisp)
MsgBox ("URL : " & URL)
MsgBox ("TargetFrameName : " & TargetFrameName)
MsgBox ("StatusCode : " & StatusCode)
MsgBox ("Cancel : " & Cancel)
End Sub

Private Sub IE_NavigateComplete( _
ByVal pDisp As Object, _
ByVal URL As Variant)

MsgBox ("navig complete")

End Sub
The fact is that neither IE_NavigateComplete nor IE_NavigateError are
called even if the url is correct or not.

I've tried to use Public WithEvents IE As SHDocVw.WebBrowser & Public
WithEvents IE As SHDocVw.InternetExplorer however Word says me that :
"the procedure declaration doesn't match the event description or the
procedure of the same name".

Do you know a way to correct this problem ?

Regards,
75Blured.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top