Home » Developer & Programmer » Forms » inserting data to a word file
inserting data to a word file [message #181446] Mon, 10 July 2006 03:08 Go to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

Hii all

i want to insert record from a table and put it in a word file
how can i do this


Thanks for everyone helped and helping me
Re: inserting data to a word file [message #181860 is a reply to message #181446] Tue, 11 July 2006 23:53 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Use DDE
Re: inserting data to a word file [message #181872 is a reply to message #181446] Wed, 12 July 2006 00:49 Go to previous messageGo to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

someone help me plz??????????
Re: inserting data to a word file [message #181945 is a reply to message #181872] Wed, 12 July 2006 05:31 Go to previous messageGo to next message
bhupinderbs
Messages: 67
Registered: July 2006
Location: Bangalore
Member
Hi

You can use TEXT_IO builtin package or use DDE. Here is code for DDE.


DECLARE
APPID PLS_INTEGER;
CONVID PLS_INTEGER;
DOCID PLS_INTEGER;
SYS_DATE CHAR(8);
EMP_NAME CHAR(40);
BEGIN
SELECT TO_CHAR(SYSDATE,'MM/DD/YY') INTO SYS_DATE FROM DUAL;

EMP_NAME := 'TESTING 1 2 3 4';

APPID := DDE.APP_BEGIN('C:\Program Files\Microsoft Office\Office\WINWORD.EXE',
DDE.APP_MODE_MINIMIZED);

CONVID := DDE.INITIATE('WINWORD','SYSTEM');

DDE.EXECUTE(CONVID,'[FileOpen "c:\bhupinder\name.doc"]', 10000);

DOCID := DDE.INITIATE('WINWORD','c:\bhupinder\name.doc');

DDE.POKE(DOCID,'BOOKMARK1', :poke_test,DDE.CF_TEXT,10000);
DDE.POKE(DOCID,'BOOKMARK2', :poke_test2,DDE.CF_TEXT,10000);

DDE.EXECUTE(DOCID,'[FileSaveAs "c:\bhupinder\name123.doc"]', 10000);

DDE.TERMINATE(CONVID);

DDE.TERMINATE(DOCID);
EXCEPTION
WHEN DDE.DDE_APP_FAILURE THEN
MESSAGE('WORD FOR WINDOWS CANNOT START.');
WHEN DDE.DDE_PARAM_ERR THEN
MESSAGE('A NULL VALUE WAS PASSED TO DDE');
WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
MESSAGE('DDE CANNOT ESTABLISH A CONVERSATION');
WHEN DDE.DMLERR_NOTPROCESSED THEN
MESSAGE('A TRANSACTION FAILED');
END;

This will solve your problem.

Bhupinder Singh
Re: inserting data to a word file [message #181954 is a reply to message #181446] Wed, 12 July 2006 06:04 Go to previous messageGo to next message
emadbsb
Messages: 334
Registered: May 2005
Location: egypt
Senior Member

thanks for your reply

i have another question on this issue

if i that word file already containning a data fields
and i want to insert after this fields

e.g
the word file have a field of "name"

name:



i want to insert to that word file the value of the name from a table so that the word file looks like

name:emad



"emad" is a field from a table i want to insert it to that word file

[Updated on: Wed, 12 July 2006 06:05]

Report message to a moderator

Re: inserting data to a word file [message #182393 is a reply to message #181945] Fri, 14 July 2006 09:13 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Look at the answer in one of your other threads.

David
Previous Topic: STACK_OVERFLOW ERROR
Next Topic: LOV Problem
Goto Forum:
  


Current Time: Fri Sep 20 11:33:38 CDT 2024