anyone know how I can display an xml doc after updating. within a vb app
cheers
R
Printable View
anyone know how I can display an xml doc after updating. within a vb app
cheers
R
IE will open ab XML document.
could I use something like for example the webbrowser so its within my main app. e.g when the user clicks a cmd button it loads the xml into it?
cheers
R
I've never tried it. Let me know if it works. ;)
I managed to do it the easy way lol and just load it in a text box using this code
VB Code:
Private Sub cmdLoadXML_Click() Dim xmlDoc As New DOMDocument Dim xmlRootElement As IXMLDOMElement Dim xmlError As IXMLDOMParseError Dim success As Boolean xmlDoc.async = False xmlDoc.validateOnParse = True success = xmlDoc.Load("c:/mgamerz/audiolist.xml") If success = True Then Set xmlRootElement = xmlDoc.documentElement txtXML.Text = xmlRootElement.xml Set xmlRootElement = Nothing Else Set xmlError = xmlDoc.parseError txtXML.Text = "Error code: " & xmlError.errorCode & vbCrLf _ & "Reason: " & xmlError.reason & vbCrLf _ & "Source: " & vbCrLf & xmlError.srcText & vbCrLf _ & "URL: " & xmlError.url Set xmlError = Nothing End If End Sub
IE formats it nicely. That's why I wondered if the web browser control did.
Glad you got it working.
yeah it isnt to well formatted as it is is it done in a similar way using IE? I wanted it to be in a box within the app can this be done with IE and how hard is it?
Thanks
R
You just put the control on a form, and that's it. I don't have any code handy. I use the web browser, or Inet control.
is that a reference or component?
Also would I be able to use the same code but replace the textbox with the webbrowser1?
thanks
Rob
I can't find any code to open it in a form. not sure that it wasn't a web browser
that's why you should try it to see if it IS the same as IE. open the file with
file:\\myxml.xml instead of http:\\