string ls_colname
integer i,j
for i = 1 to ll_colnum
//得到标题头的名字
ls_colname = dw_1.describe('#' + string(i) + ".name") + "_t"
ls_value = dw_1.describe(ls_colname + ".text")
ole_object.Selection.TypeText(trim(ls_value))
ole_object.Selection.MoveRight(wdCell)
next
dw_1.setredraw(false)
ole_object.Selection.MoveLeft(wdCell)
for i = 2 to ll_rownum
for j = 1 to ll_colnum
dw_1.scrolltorow(i - 1)
dw_1.setcolumn(j)
ls_value = dw_1.gettext()
ole_object.Selection.MoveRight(wdCell)
ole_object.Selection.TypeText(ls_value)
next
next
dw_1.setredraw(true)
constant long wdFormatDocument = 0
//保存新建的文档
ole_object.ActiveDocument.SaveAs("sample.doc", 0,False,"",True,"",False,False,False, False,False)