rainbowsoftware
asked on
Using DDEClientConv
I use a DDEClientConv to transfer data to a bookmarked Word document by using
DdeClientConv1.PokeData('N ame', 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
DdeClientConv1.PokeData('N
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
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 ..
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 ..
ASKER
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
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 ;-)
it dont matter comobj be better anyway ..happy learning ;-)
ASKER
Thanks again, it works perfect.
Joern
Joern
i can give example of using ole to insert text at a bookmark in word if that helps ..