自己捉摸出来了,曲线实现。
'定义HTM文件内容
Dim htm As String = "" & vbcrlf
htm = htm & "" & vbcrlf
htm = htm & "
" & vbcrlfhtm = htm & "" & vbcrlf
htm = htm & "" & vbcrlf
htm = htm & "
" & vbcrlfhtm = htm & Tables("sy_files").Current("filetext") & vbcrlf '指定单元格HTM代码内容
htm = htm & "" & vbcrlf
htm = htm & ""
'生在HTM文件
FileSys.WriteAllText(ProjectPath & "print.htm",htm, True)
'生成Doc文件
Dim s As String = FileSys.ReadAllText(ProjectPath & "print.htm") '这里是读取html文件内容,也可以改为取HTML编辑器的网页内容
Dim sw As new io.StreamWriter("d:\abc.doc", False, system.text.Encoding.GetEncoding("utf-8"))
sw.WriteLine(s)
sw.Flush()
sw.Close()