Can't help you with the return value (although you may see how to extend the
following idea), but here is how we pass parameters. Before I start, I should
say that this was all done under Word 2. I don't know whether it is applicable
under Word 6 and there may be a better way (may have been a better way under
Word 2!!).
We use DDE. We have a DDE server in the PB app. We set an instance variable
in the appropriate place for the server: the instance variable holds a string
which consists of the commands we would like Word to execute delimited by an
unused character (ASCII 1). We loop in WordBasic sending a string
"next_word_command" to the DDE server. The DDE Server responds by splitting
the string and sending a command. These commands are Macro names. The server
executes the macro. The macro knows how many parameters it is expecting and
requests them with the "next_word_command" (the parameters have been queued
after the command). It then executes the appropriate command.
A typical string might be (delimited by a comma):
ViewNormal,GoToBookmark,Name,ReplaceBookmark,Mark Nolan,FilePrint
Tedious isn't it! In fact, it uses very little code and is remarkably fast.
I'm sure you could improve on this method and adapt it to send return codes
back. If no one comes back with a better suggestion and you would like to try
this, let me know and we can discuss it in more detail.
--
Mark Nolan
"Any comments or statements made are not necessarily those of
J.P. Morgan & Co. Incorporated, its subsidiaries or affiliates."