沙漠飞雪 发表于 2010-12-10 16:50:30

如果在linux下,测试OpenOffice呢?

iamfeiyu1009 发表于 2010-12-10 21:00:53

这样也可以写的,不过读时会出现乱码
建议你可以查看word帮助里的vb参照
Const ForReading = 1, ForWriting = 2, ForAppending = 8

Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0

Dim fso, f, ts

Set fso = CreateObject("Scripting.FileSystemObject")

Set f = fso.GetFile("c:\test1.txt")

Set ts =f.OpenAsTextStream(ForWriting,TristateUseDefault)

ts.Write "Hello World"

ts.close
页: 1 [2]
查看完整版本: QTP怎样才能往word里面写东西?