WebBrowser BeforeNavigate PostData-VBForums
Results 1 to 2 of 2

Thread: WebBrowser BeforeNavigate PostData

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Posts
    118

    WebBrowser BeforeNavigate PostData

    Is there a way to decipher the actuazl data in the PostData parameter within the before navigate function? I have searched around and it appears that it is a SAFEARRAY structure, but I have yet to figure out how to crack into it.

    If someone can crack this problem, I believe it is a path to automating ( or making program internet interface self learning ) the form submission problems that are consistently posted in these forums.

    I would also be interested in any other approach in which I can grab the postdata information after the browser has massaged it, but before it sends it out.
    Last edited by VBZeroPlus; Nov 5th, 2002 at 10:00 AM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Posts
    118

    ***RESOLVED***

    In case anyone is interested, the soilution to my question is actually very easy ( in hindsight ). Here is the core to my solution:

    Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
    Dim TestString As String
    ""

    If Len(PostData) <> 0 Then
    Dim MyVar As Variant

    MyVar = PostData
    If VarType(MyVar) = (vbArray Or vbByte) Then
    Dim Bytes() As Byte
    Bytes = MyVar
    TestString = ""
    For Test = 0 To 500
    If Bytes(Test) = 0 Then Exit For
    TestString = TestString + Chr(Bytes(Test))
    Next Test

    Debug.Print TestString

    End If
    End If

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.