Board index » delphi » DDE Word 97

DDE Word 97

Hello All,

I need help about DDE between Delphi 4 and Word 97.

I know i should use OLE, but i did a DDE program which works very well with
Delphi 1 and Word 6, so i'd like to still use it again.
Does anyone have already write a DDE for word 97?

I managed to make Word opening, but i don't manage to send macros to Word.
They are not well interpreted. I need the right syntax.
For example i write :

DdeClientConv1.ExecuteMacro('[Documents.Open FileName:=
"ind10m.DOC"]',false) ;

a error occurs in the visual basic editor, because it receives a different
command like :

WordBasic.call "Documents.Open", FileName:= "ind10m.DOC"

Could you help me please?

Nataly

 

Re:DDE Word 97


You really should use OLE Automation. DDE is a rather old and primitive
technology.

Henrik

Quote
Nataly wrote:
> Hello All,

> I need help about DDE between Delphi 4 and Word 97.

> I know i should use OLE, but i did a DDE program which works very well with
> Delphi 1 and Word 6, so i'd like to still use it again.
> Does anyone have already write a DDE for word 97?

> I managed to make Word opening, but i don't manage to send macros to Word.
> They are not well interpreted. I need the right syntax.
> For example i write :

> DdeClientConv1.ExecuteMacro('[Documents.Open FileName:=
> "ind10m.DOC"]',false) ;

> a error occurs in the visual basic editor, because it receives a different
> command like :

> WordBasic.call "Documents.Open", FileName:= "ind10m.DOC"

> Could you help me please?

> Nataly

Re:DDE Word 97


I NEED to use DDE for the moment, it's an emergency.
I will use OLE when i will have time to study it.
So if anyone could help me about DDE, i will be very grateful.

Nataly

Henrik Madsen a crit dans le message <3794A8CF.A2026...@my-deja.com>...

Quote
>You really should use OLE Automation. DDE is a rather old and primitive
>technology.

>Henrik

>Nataly wrote:

>> Hello All,

>> I need help about DDE between Delphi 4 and Word 97.

>> I know i should use OLE, but i did a DDE program which works very well
with
>> Delphi 1 and Word 6, so i'd like to still use it again.
>> Does anyone have already write a DDE for word 97?

>> I managed to make Word opening, but i don't manage to send macros to
Word.
>> They are not well interpreted. I need the right syntax.
>> For example i write :

>> DdeClientConv1.ExecuteMacro('[Documents.Open FileName:=
>> "ind10m.DOC"]',false) ;

>> a error occurs in the visual basic editor, because it receives a
different
>> command like :

>> WordBasic.call "Documents.Open", FileName:= "ind10m.DOC"

>> Could you help me please?

>> Nataly

Re:DDE Word 97


They changed from WordBasic in Word6, to VBA in Word97. It tries to provide
backward compatibility by automatically prefixing all of the old commands
with "WordBasic.". In this case it is trying to "Call" a macro with the name
(it thinks) "Documents.Open FileName (etc)". I remember having a similar
problem with DDE when upgrading from Word6 to 97.

This will work:
DdeClientConv1.ExecuteMacro('[FileOpen("ind10m.DOC")]',false) ; // using
your example filename (hope it exists)

Other DDE tips for Word97:
To run macros, instead of "Call", use "ToolsMacro", e.g.,
[ToolsMacro .Name="NAMEOFMACRO" .Run=1]
It used to be:
[CALL NAMEOFMACRO]
in Word6, but that will not work in Word97.

You can find out what will work and will not work, by first trying out the
commands with "WordBasic." prefixed in the Macro Editor in Word97 (knowing
that when it receives the commands via DDE, it is going to try and prefix
them with "WordBasic.")

If you distribute macros with your software, (e.g. in version of
Normal.dot), you can do a lot by executing them with [ToolsMacro .Name=
(etc) - and they can read in information from a temporary text file about
filenames to open, merge etc: That way you can make use of some of the
goodies in VB, like dialog boxes to confirm steps etc.

Hope it helps!

Steve
http://www.geocities.com/SiliconValley/Sector/6376

Quote
Nataly <n...@easynet.fr> wrote in message

news:7n235k$2be9$1@buggy.easynet.fr...
Quote
> Hello All,

> I need help about DDE between Delphi 4 and Word 97.

> I know i should use OLE, but i did a DDE program which works very well
with
> Delphi 1 and Word 6, so i'd like to still use it again.
> Does anyone have already write a DDE for word 97?

> I managed to make Word opening, but i don't manage to send macros to Word.
> They are not well interpreted. I need the right syntax.
> For example i write :

> DdeClientConv1.ExecuteMacro('[Documents.Open FileName:=
> "ind10m.DOC"]',false) ;

> a error occurs in the visual basic editor, because it receives a different
> command like :

> WordBasic.call "Documents.Open", FileName:= "ind10m.DOC"

> Could you help me please?

> Nataly

Re:DDE Word 97


It works!!!!
Alleluia it works!!!
After a whole week, i was becoming crazy.
Thanks so much Steve. Sincerely :0)
But how do you find the good commands?
How do you know that instead of "Documents.Open FileName " i have to use
"FileOpen"?
I need a lot of others command to merge, print, close, quit,... Where can i
find them?
I'm so happy :0)
Thanks, you are the only one who helped me.
Have a wonderful day,

Nataly

*********************************************************
Steve Moran a crit dans le message <7n4b08$ji...@forums.borland.com>...
They changed from WordBasic in Word6, to VBA in Word97. It tries to provide
backward compatibility by automatically prefixing all of the old commands
with "WordBasic.". In this case it is trying to "Call" a macro with the name
(it thinks) "Documents.Open FileName (etc)". I remember having a similar
problem with DDE when upgrading from Word6 to 97.

This will work:
DdeClientConv1.ExecuteMacro('[FileOpen("ind10m.DOC")]',false) ; // using
your example filename (hope it exists)

Other DDE tips for Word97:
To run macros, instead of "Call", use "ToolsMacro", e.g.,
[ToolsMacro .Name="NAMEOFMACRO" .Run=1]
It used to be:
[CALL NAMEOFMACRO]
in Word6, but that will not work in Word97.

You can find out what will work and will not work, by first trying out the
commands with "WordBasic." prefixed in the Macro Editor in Word97 (knowing
that when it receives the commands via DDE, it is going to try and prefix
them with "WordBasic.")

If you distribute macros with your software, (e.g. in version of
Normal.dot), you can do a lot by executing them with [ToolsMacro .Name=
(etc) - and they can read in information from a temporary text file about
filenames to open, merge etc: That way you can make use of some of the
goodies in VB, like dialog boxes to confirm steps etc.

Hope it helps!

Steve
http://www.geocities.com/SiliconValley/Sector/6376

Quote
Nataly <n...@easynet.fr> wrote in message

news:7n235k$2be9$1@buggy.easynet.fr...
Quote
> Hello All,

> I need help about DDE between Delphi 4 and Word 97.

> I know i should use OLE, but i did a DDE program which works very well
with
> Delphi 1 and Word 6, so i'd like to still use it again.
> Does anyone have already write a DDE for word 97?

> I managed to make Word opening, but i don't manage to send macros to Word.
> They are not well interpreted. I need the right syntax.
> For example i write :

> DdeClientConv1.ExecuteMacro('[Documents.Open FileName:=
> "ind10m.DOC"]',false) ;

> a error occurs in the visual basic editor, because it receives a different
> command like :

> WordBasic.call "Documents.Open", FileName:= "ind10m.DOC"

> Could you help me please?

> Nataly

Re:DDE Word 97


There is a help file called "vbawrd8.hlp" that comes with Office 97. On my
pc, it is in "C:\Program Files\Microsoft Office\Office". When installing
Office, you can select "Install Visual Basic Help Files" (I forget if that
is Custom Install, Standard or whatever.) It contains a section called
"Visual Basic equivalents for WordBasic commands". There is a lot of
information there. It is a bit confusing, because FileOpen is actually an
old command. All of the old commands can be used when prefixed with
"WordBasic." - it seems to decide for itself when to do this too. I do not
really know why some of these things work this way.

Other old commands that I think might work ok (I have not tested them) are,
in the order needed for mail merging:
EditSelectAll
UpdateFields
MailMergeMainDocumentType
MailMergeOpenDataSource
MailMerge
FileClose

Those are the only ones I see in our old program (actually in a Word macro,
executed from our old program). Since using these we have now switched to
OLE. There is a superb guide and example code for OLE at www.softmosis.com .
I know it is not easy to change old programs to use different techniques,
just like that.

Hope the happiness lasts! 8-)

Steve

Quote
Nataly <n...@easynet.fr> wrote in message

news:7n4e3i$f9t$1@buggy.easynet.fr...
Quote
> It works!!!!
> Alleluia it works!!!
> After a whole week, i was becoming crazy.
> Thanks so much Steve. Sincerely :0)
> But how do you find the good commands?
> How do you know that instead of "Documents.Open FileName " i have to use
> "FileOpen"?
> I need a lot of others command to merge, print, close, quit,... Where can
i
> find them?
> I'm so happy :0)
> Thanks, you are the only one who helped me.
> Have a wonderful day,

> Nataly

Re:DDE Word 97


Quote
>There is a help file called "vbawrd8.hlp" that comes with Office 97.

I've already read that help, but it isn't the same commands that you gave
me.
Anyway, i'll try to find the other commands by myself.
I found AppClose to quit winword, and i'm gonna try again to find the merge
ones with your help :0)

Thanks again for all the help you gave me Steve.

Take care,

Nataly

Re:DDE Word 97


It's also very slow.

Henrik Madsen <henri...@my-deja.com> skrev i en
nyhedsmeddelelse:3794A8CF.A2026...@my-deja.com...

Quote
> You really should use OLE Automation. DDE is a rather old and primitive
> technology.

> Henrik

> Nataly wrote:

> > Hello All,

Re:DDE Word 97


Well, if the DDE link i'm using is slow, then i'd like all my applications
to be as slow as it is ;0)

Nataly

Quote
>It's also very slow.

>> You really should use OLE Automation. DDE is a rather old and primitive
>> technology.

>> Henrik

>> Nataly wrote:

>> > Hello All,

Re:DDE Word 97


Can I suggest that you take a look at our own DDE component - 'Django'.

'Django' is a full implementation of all DDE functions delivered in a single
powerful but easy to deploy component. The product comes with seven demo
projects, a 110 page tutorial/reference doc in WORD format, and extensive on
line help.

You can download an evaluation version from our web site at...

 http://dspace.dial.pipex.com/town/estate/ns21/icfmdc.htm

Regards,

 .... ICFM Software

Quote
Nataly <n...@easynet.fr> wrote in message

news:7nhe42$rdq$1@buggy.easynet.fr...
Quote
> Well, if the DDE link i'm using is slow, then i'd like all my applications
> to be as slow as it is ;0)

> Nataly

> >It's also very slow.

> >> You really should use OLE Automation. DDE is a rather old and primitive
> >> technology.

> >> Henrik

> >> Nataly wrote:

> >> > Hello All,

Other Threads