OK解決了,這裏是代碼如下
Sub main()
Dim fs As Object, f As Object, i As Integer
Set fs = CreateObject("Scripting.FileSystemObject")
Call createFile(f, fs, "Z:\Tablets\output.html")
i = 2
While Cells(i, 1) <> ""
Call writeTab(f, 2, "<li>")
Call writeTab(f, 3, "<a href=""#"" onclick=""window.plugins.videoPlayer.play('file:///storage/emulated/0/nepal/" & Cells(i, 1) & ".mim');"">")
Call writeTab(f, 4, "<img src=""img/icons/" & Cells(i, 1) & ".jpg"" alt="""" />")
Call writeTab(f, 4, "<div class=""channel-info"">")
Call writeTab(f, 5, "<h1>" & Cells(i, 4) & "</h1>")
Call writeTab(f, 4, "</div>")
Call writeTab(f, 3, "</a>")
Call writeTab(f, 2, "</li>")
i = i + 1
Wend
Set f = Nothing: Set fs = Nothing
End Sub
Sub createFile(fileObject As Object, fso As Object, fileName As String, Optional utf16 As Integer = 0)
Set fileObject = fso.opentextfile(fileName, 2, True, utf16)
End Sub
Sub writeTab(f As Object, ByVal t As Integer, ByVal s As String)
Dim tabString As String, i As Integer
For i = 1 To t
tabString = tabString & Chr(9)
Next i
f.writeline tabString & s
End Sub