This inserts <HTML> tags inside the <BODY> element! You really shouldn't be doing this!
Try using doc.open(), doc.write() and doc.close() IIRC these are IDispatch-only methods, so you'll need to either use VB.Net or Reflection. This post shows an example using Reflection: http://discuss.develop.com/archives/wa.exe?A2=ind0111C&L=DOTNET&P=R36644&I=- 3 Regards, Richard Kirk Allen wrote: > > I didn't see the post regarding mshtml without a winform, but you > should be > able to simply use it as a parser through interop. This is VB6 > code, but it > should work the same in .NET and should not require a UI. Is this similar > to what you already tried? If so, what issues did you have? > > Dim doc As MSHTML.HTMLDocument > Dim node As MSHTML.IHTMLElement > > Set doc = New MSHTML.HTMLDocument > doc.body.innerHTML = > "<html><head><title>test</title></head><body><h1>Hello,world</h1><span > id=""test"">A test</span></body></html>" > > Set node = doc.getElementById("test") > Debug.Print node.innerText > > Set node = Nothing > Set doc = Nothing You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.