Link to home
Start Free TrialLog in
Avatar of rainbowsoftware
rainbowsoftware

asked on

Using DDEClientConv

I use a DDEClientConv to transfer data to a bookmarked Word document by using

DdeClientConv1.PokeData('Name', PChar(Edit1.Text));

It works OK, when I run the program from the Delphi platform, but running the program from outside the Delphi platform it doesn't work.

The MS-Word opens with the correct doc-file but, no data are transferred, using the PokeData procedure.
Can anybody tell me why?

Joern
Avatar of inthe
inthe

might be better to post some more code ..

i can give example of using ole to insert text at a bookmark in word if that helps ..
Avatar of rainbowsoftware

ASKER

I create and open the link by:

if DdeClientConv1.SetLink( 'WINWORD', 'Letter.doc' ) then DdeClientConv1.OpenLink;

And I transfer the data to the bookkmark by:

DdeClientConv1.PokeData( 'Name', PChar(Edit1.Text));

I have tried to write the whole path to Winword.exe:
 C:\Program Files\Microsoft office\Office\Winword

and the whole path to the doc:

C:\Documents\Letter.doc

but still it doesn't work, outside the Delphi platform.

Have you got another way to do it?

Joern

only using ole ,dde always fails..
he is right rainbow. DDE is not worth trying.
ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
note,
to learn all the commands you can use you really need the vba help file ,this comes with most versions of office or it can be downloaded from various web sites just search for vba.hlp or something ..
Thanks very much to Barry for the code, and the links.
I can't use AutoOle, but ComObj is OK. Is it because I use Delphi 3?

Joern
in delphi3 you should have some ole files in your delphi lib directory under the directory called delphi2..

it dont matter comobj be better anyway ..happy learning ;-)
Thanks again, it works perfect.
Joern