在之前有提供一些生成文本文件的FORM例子,但用户往往是再用Excel等工具去进行编辑。现提供一直接可以从FROM中生成EXCEL文件的事例. 现提供一简单实例,说明怎样使用FORM实现与EXCEL的应用程序的DDE。 要实现该演示功能:
1. 安装好EXCEL; 2. 按照程序中的路经说明建立一个相应的.XLS文件。 3. 主要的程序单元如下: 4.:invd21.dh为块中的一field DECLARE AppID PLS_integer; ConvID PLS_INTEGER; server varchar2(100); BEGIN server := 'c:\progra~1\micros~1\Office'; begin AppID := DDE.App_Begin(server'\excel.exe 'current_form_path'book161.xls',DDE.App_Mode_Maximized); exception when others then message('Can not Find Your Office Path, Please Try Again'); raise form_trigger_failure; end; DDE.App_Focus(AppID); ConvID := DDE.Initiate('EXCEL', current_form_path'book161.xls'); begin DDE.Poke(ConvID, 'R1C8', :invd21.dh, DDE.CF_TEXT,9000); exception when others then null; end; DDE.Terminate(ConvID); END; 
|