I am using Webbrowser control to fill few values from database.

VB Code:
  1. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
  2.  
  3.         Dim HTML As HTMLDocument
  4.  
  5.      If (pDisp Is WebBrowser1.Application) Then
  6.    
  7.          Set HTML = WebBrowser1.Document
  8.  
  9.         HTML.All.Item("User").Value = "userid"
  10.     End if
  11.  
  12. end sub


In the document complete event i am filling up few text box values.

Is there any way to check if the element exists in the page or not ?

For example only if the "User" element is found i need to fill the value.

Please help..