Write the font table 写入字体表
sRTF = "{\fonttbl {\f0\froman\fcharset0 Times New Roman;}" & "{\f1\fswiss\fcharset0 Arial;}" & "{\f2\fmodern\fcharset0 Courier New;}}"
MyFile.WriteLine sRTF
Write the title and author for the document properties 设置文档标题和作者
MyFile.WriteLine("{\info{\title 测试文档}" & "{\author 罗军}}")
Write the document header and footer 设置页眉与页脚
MyFile.WriteLine("{\header\pard\qc\brdrb\brdrs\brdrw10\brsp100" & "{\fs20 页眉} \par}")
MyFile.WriteLine("{\footer\pard\qc\brdrt\brdrs\brdrw10\brsp100" & "{\fs18 页脚} \par}")
我在使用使用以上语句向word中写入数据时是正确的,但是用word打开这个文档后,中文字体全是乱码,我在写入字体表的代码中加入中文“宋体”,还是不行,如以下语句:
Write the font table 写入字体表
sRTF = "{\fonttbl {\f0\froman\fcharset0 宋体;}" & "{\f1\fswiss\fcharset0 Arial;}" & "{\f2\fmodern\fcharset0 Courier New;}}"
MyFile.WriteLine sRTF
请教专家,怎样进行字体设置?
可以在页面里面设置吧。
试试先写入字体表,再写内容(已经写入的内容需要选定才能更改字体).
我看着像RTF