Hi all,

I have received loads of valuable advice from people here whilst doing a small project that updated an xml mp3 playlist. I am now attempting to do the same concept with a picture viewer. I have tried to adapt the code used for my mp3 updater but I am stuck with how to display the xml file properley. I have this code so far

VB Code:
  1. Private Sub Command1_Click()
  2.  
  3.  
  4.     Dim f1 As Integer, info As String, imagename As String, songpath As String, mp3path As String, description As String, imagepath As String, f2 As Integer, i As Integer
  5.    
  6.    
  7.     mp3path = "C:\WED\"
  8.    
  9.      f2 = FreeFile
  10.     Open mp3path & "mp3.txt" For Output As #f2
  11.      f1 = FreeFile
  12.     intro = TextBox1.Text
  13.     imagename = TextBox2.Text
  14.     f3 = FreeFile
  15.    
  16.     Open mp3path & "audiolist.xml" For Output As #f1
  17.     Print #f1, "<?xml version=""1.0""?>"
  18.  
  19.    
  20.     Print #f1, "<imagedata>"
  21.     Print #f1, "<image imagename=""" & imagename & info; """  />"
  22.     songname = Dir(mp3path & "\*.jpg")   ' get first image
  23.     i = 1
  24.     While Not Len(songname) = 0
  25.         info = "<info=""" & mp3path & songname & """ title=""" & songname & """/> "
  26.         intro = "<intro=""" & intro & """/>"
  27.         imagename = "<images=""" & imagename & """ & intro=""" & """/>"
  28.        
  29.         Print #f1, info
  30.         Print #f1, intro
  31.        
  32.         Sleep 100
  33.         songname = Dir
  34.    
  35.     Wend
  36.    
  37.  
  38. Close
  39. End Sub

But I need to get the xml file like this as I can only seem to get it on different lines
<imagedata>


<image imagename="My home" info="images/mtns_shot.jpg">
<intro>This is the great smoky mountains</intro>
</image>


</imagedata>

Thanks
Rob