Her er lige lidt mere kode:
------------------
Private Sub Timeout_stop()
If MsgBox("Der er opstået en fejl - siden kunne ikke findes.", vbRetryCancel, "Fejl") = vbRetry Then MainUpdate Else
End
End Sub
------------------
Sub MainUpdate()
txtMain.Text = ""
'strURL "
http://www.f1racing.net/en/xml/rss/en.xml"Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async = False
xmlDoc.Load strURL
If ScriptControl1.Timeout Then Timeout_stop 'fejl håndtering
For Each x In xmlDoc.documentElement.childNodes
For Each y In x.childNodes
'----------------------
If y.nodeName = "title" Then
txtMain.Text = txtMain.Text & y.Text & vbCrLf '& vbcrlf 'x.nodename & x.nodename & x.text & vbcrlf 'y.item(i-1).getAttribute("code") & ": " & y.item(i-1).getAttribute("desc") & ": " & y.item(i-1).getAttribute("rate") & vbcrlf
txtMain.Text = (txtMain.Text) & vbCrLf '& vbcrlf
Else
If y.nodeName = "link" Then
txtMain.Text = txtMain.Text & y.Text & vbCrLf '& vbcrlf 'x.nodename & x.nodename & x.text & vbcrlf 'y.item(i-1).getAttribute("code") & ": " & y.item(i-1).getAttribute("desc") & ": " & y.item(i-1).getAttribute("rate") & vbcrlf
txtMain.Text = txtMain.Text & vbCrLf & "----------------" & vbCrLf
Else
If y.nodeName = "description" Then
txtMain.Text = txtMain.Text & y.Text & vbCrLf '& vbcrlf 'x.nodename & x.nodename & x.text & vbcrlf 'y.item(i-1).getAttribute("code") & ": " & y.item(i-1).getAttribute("desc") & ": " & y.item(i-1).getAttribute("rate") & vbcrlf
txtMain.Text = txtMain.Text & vbCrLf & "----------------" & vbCrLf
End If
End If
End If
'----------------------
'Text1.FontBold = True
For Each z In y.childNodes
If z.nodeName = "title" Then
txtMain.Text = txtMain.Text & z.Text & vbCrLf '& vbcrlf 'x.nodename & x.nodename & x.text & vbcrlf 'y.item(i-1).getAttribute("code") & ": " & y.item(i-1).getAttribute("desc") & ": " & y.item(i-1).getAttribute("rate") & vbcrlf
txtMain.Text = txtMain.Text '& vbcrlf
Else
If z.nodeName = "link" Then
txtMain.Text = txtMain.Text & z.Text & vbCrLf '& vbcrlf 'x.nodename & x.nodename & x.text & vbcrlf 'y.item(i-1).getAttribute("code") & ": " & y.item(i-1).getAttribute("desc") & ": " & y.item(i-1).getAttribute("rate") & vbcrlf
txtMain.Text = txtMain.Text & vbCrLf
Else
If z.nodeName = "description" Then
txtMain.Text = txtMain.Text & z.Text & vbCrLf '& vbcrlf 'x.nodename & x.nodename & x.text & vbcrlf 'y.item(i-1).getAttribute("code") & ": " & y.item(i-1).getAttribute("desc") & ": " & y.item(i-1).getAttribute("rate") & vbcrlf
txtMain.Text = txtMain.Text & vbCrLf & "----------------" & vbCrLf
End If
End If
End If
Next
Next
Next x
End Sub
-----------------
I må sige til hvis i mangler andet
Hygge