Private Function WebServiceMethod() As Boolean Dim loHtmlDocument As System.Windows.Forms.HtmlDocument = Nothing ' Initialization loHtmlDocument = GetHtmlDocument() loHtmlDocument.GetElementById("DivInner").InnerHtml = "Test" Return True End Function Private Delegate Function GetHtmlDocumentCallBack() As System.Windows.Forms.HtmlDocument ' This is needed to have safe cross-threading because of the timer Private Function GetHtmlDocument() As System.Windows.Forms.HtmlDocument ' If true If Log.InvokeRequired Then Return Log.Invoke(New GetHtmlDocumentCallBack(AddressOf GetHtmlDocument)) Else Return Log.Document End If End Function