i] ole_object.cells(1,i).value = ls_value next
string column_name for i = 2 to ll_rownum for j = 1 to ll_colnum column_name = ls_objs[j] if adw.Describe(column_name + '.type') = 'column' then ls_value = adw.Describe("Evaluate('LookupDisplay("+column_name+")',"+string(i - 1)+")") end if if adw.Describe(column_name + '.type') = 'compute' then ls_value = adw.Describe("Evaluate('" + adw.Describe(column_name + '.expression') + "',"+string(i - 1)+")") end if ole_object.cells(i,j).value = ls_value next next
SetPointer(oldpointer)
ole_object.disconnectobject() DESTROY ole_object
return 1 end function
三、PBToWord函数f_outputtoword_new.srf
$PBExportHeader$f_outputtoword_new.srf global type f_outputtoword_new from function_object end type
forward prototypes global function integer f_outputtoword_new (datawindow adw) end prototypes
global function integer f_outputtoword_new (datawindow adw); //函数名:f_outputtoword_new //输入: adw - datawindow,指定的数据窗口 //返回值: Integer constant integer ppLayoutBlank = 12 OLEObject ole_object ole_object = CREATE OLEObject
integer li_ret
li_ret = ole_object.ConnectToObject("","word.application") IF li_ret <> 0 THEN //如果Word还没有打开,则新建。 li_ret = ole_object.ConnectToNewObject("word.application") if li_ret <> 0 then MessageBox('OLE错误','OLE无法连接!错误号:' + string(li_ret)) return 0 end if ole_obje上一页 [1] [2] [3] [4] [5] 下一页
|