DDE from FPW2.6 to Word 97

DDE from FPW2.6 to Word 97

Post by Jan van 't Vee » Tue, 13 Oct 1998 04:00:00



I'm trying to start a macro in Word from my app. I already got it running
using WordPerfect but I'm getting a bit confused trying to let 2 MS app's
work together.

What I tried is:
    = ddesetoption('safety',.f.)
    chan = ddeinitiate('WinWord','System')
    if chan < 0
        ! C:\Progra~1\Micros~2\Office\WINWORD.EXE /n
        chan = ddeinitiate('WinWord','System')
    endif
    = ddeexecute(chan,'[Application.Run MacroName:="Test1"]')
    = ddeterminate(chan)

What I got was a confusing error from VBA indicating that I was using a
non-existent Wordbasic-command.


 
 
 

DDE from FPW2.6 to Word 97

Post by Loris Antonangel » Wed, 14 Oct 1998 04:00:00



> I'm trying to start a macro in Word from my app. I already got it running
> using WordPerfect but I'm getting a bit confused trying to let 2 MS app's
> work together.

> What I tried is:
>     = ddesetoption('safety',.f.)
>     chan = ddeinitiate('WinWord','System')
>     if chan < 0
>         ! C:\Progra~1\Micros~2\Office\WINWORD.EXE /n
>         chan = ddeinitiate('WinWord','System')
>     endif
>     = ddeexecute(chan,'[Application.Run MacroName:="Test1"]')
>     = ddeterminate(chan)

> What I got was a confusing error from VBA indicating that I was using a
> non-existent Wordbasic-command.



1)
Maybe the problem is not in the call you give, but inside the Macro

2)
Maybe you are using the wrong Word version. Macros language has changed
a lot during the years. Does the macro run when you issue it from within
Word (and not from Fox)?

3)
I was wondering the command

! C:\Progra~1\Micros~2\Office\WINWORD.EXE /n

How can you be sure that WinWord will always be at that location???...

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Loris Antonangeli, University of Oulu (Finland)
phone: +358-8-5565456, +358-40-5015645

http://cc.oulu.fi/~loris/loris.htm

Messages FOR FREE straight to my GSM-phone - follow instructions:
1) Go to http://www.mtn.co.za/sms/secure/text.html
2) Choose Network "Finland Telecom Finland 35840"
3) Enter my gsm-phone number +358405015645
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Ennen olin ep?varma - nyt en oikein tied?...

 
 
 

1. FMP 4.1 and DDE to open Word 97...

I've been asked to make it so that a user clicks a button, and this fires up
word, with some database information already stored.
I have no problem with the FileMaker side of this, using Sendmessage or DDE
to open word itself, but what Word 97 DDE commands are there to accept
information (sort of like a mail merge is what I'm trying to do).
Obviously the DDE service/send message will be executed from a field value -
where I can make a calculation field to format all the text and the fields
to be pushed in, and compile the command with values specific to each
record.
But I have no idea about the commands that word 97 can accept to receive the
data, and shove it on the page.
Now one way this could be done but it is too hit and miss I feel, is using
an export records script step, exporting them to CSV, firing up Excel with
DDE/send message, running a macro automatically to save the file as a .xls
Excel file using mouse movements or keyboard commands, then firing up word
from FileMaker and running another macro in word to mail merge the xls file.
I realise firstly I'll have to create a custom template for word so that the
macro can be run only when that template/filemaker button is clicked, so I
simply fire up that template run the macro to run a mail merge function on
that xls file, so it appears in word. I really don't want to have to do it
like this though as I feel it is too cumbersome, as you can tell from the
long explanation of what could go on.

Therefore does anyone know of a way that this can be made to happen through
DDE or the send message command - this way would be much sweeter and easier
to edit the format of the text that appears in word (just by editing the
calculation field) rather than having to re-record the word macro every time
a change needs to be made.
Also, using DDE and send message also means I don't have to record 50 odd
different macros and create templates for each one in word, for different
mail merge functions in filemaker.

The client does really not want to use the FMP word processing tools, and
wants to be able to keep hard copies of all documents output, therefore
DDE/send message is the way to go.

Thanks

PS: FileMaker Pro 4.11, Windows 95/98, and using office 97.

Ben Bradley

2. Does anyone know how to dump Progress tables to ASCII

3. DDE comand in WORD 97

4. dbwritetext/Error 806/Null Values in image fields

5. Word Macros via DDE from FPW2.6a

6. FoxPro programmer wanted

7. Word macros via DDE from fpw2.6

8. sqlplus login without password

9. OLE and Word 97- Word application not showing in the font but becoming an icon

10. HELP : Automating Word 97 to get contactitems from Outlook 97

11. DDE to WORD runs WORD twice?

12. DDE to Excel 97

13. FPW2.6 DDE with Quicken 6