如何顺次打印表文件(dywj.dbf)中的文件
我将顺次打印表文件(dywj.dbf)中的文件,如打印word文档、打印excel文档、显示表文件、运行程序,下列程序有点问题,恳请高手帮忙修正,万分感谢!!!
dywj.zip
(747 Bytes)
程序代码(待完善)
CLOSE ALL
CLEAR ALL
SET TALK OFF
SET SAFETY OFF
SET COMPATIBLE OFF
cCurrentProcedure = SYS(16,1)
nPathStart = AT(":",cCurrentProcedure)- 1
nLenOfPath = RAT("\", cCurrentProcedure) - (nPathStart)
mypath=SUBSTR(cCurrentProcedure, nPathStart, nLenofPath)
SET Default TO (mypath)
use dywj
SCAN
wjm=ALLTRIM(EVALUATE(fields(2)))+ALLTRIM(EVALUATE(fields(4)))
DO CASE
CASE 文件类型="doc"
wordapp=CREATEOBJECT("word.application")
wordapp.visible=.t.
wordtable=wordapp.application.Documents.open(wjm)
wordapp.ActiveDocument.printout()
wordapp.quit
CASE 文件类型="xls"
oExcel = GETOBJECT("","Excel.Sheet")
oExcelApp= oExcel.Application
oExcelApp.workbooks.open(wjm)
oExcelApp.Visible=.t.
oExcelApp.ActiveWorkbook.PrintOut()
oExcelApp=.NULL.
*oExcelApp.quit
CASE 文件类型="dbf"
use &wjm
BROWSE
CASE 文件类型="prg"
do (wjm)
ENDCASE
ENDSCAN
RETURN
[此贴子已经被作者于2018-9-29 16:49编辑过]