OLE 2.0, Powerbuilder 4.0 and MS Word

OLE 2.0, Powerbuilder 4.0 and MS Word

Post by Mark Nola » Wed, 26 Jul 1995 04:00:00



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."

 
 
 

OLE 2.0, Powerbuilder 4.0 and MS Word

Post by Keith and Tamra Frankli » Wed, 26 Jul 1995 04:00:00


We our having a problem when we invoke WordBasic commands via
PB.

Two problems:

1. If the WordBasic command returns a value how do you handle
this.

2. If the WordBasic command has parameters how do you handle
this. Example:

   We have no problem using EditFind="LastName" which in PB
becomes EditFind("LastName").  But if we need to do be able to
use wildcards we need to use the Patternamtch Parameter and the
EditFind becomes EditFind="*Name",Patternmatch=1....How do we
do this in PB, I have tried many varitions of EditFind(...) but
no luck..



ThanX in advance

Keith Franklin

 
 
 

1. Powerbuilder 4.0, OLE 2.0, and MS WordBasic

I have been working on an application that utilizes OLE 2.0
Automation to drive Word.  

I have no problem utilizing WordBasic via Powerbuilder to
populate bookmarks with data...My problem is with the process
we want to put in place for creation/maintenance of letters.

I want to use WordBasic commands such as EditFind, which in
itself works fine...But EditFind has an option called
Pattermatch that lets you do finds useing wildcards...See we
want to automatically create bookmarks while we are storing the
letter in a database.  When a user clicks a button the program
will use EditFind to search for anything that has special
characters (that we specify, for begin and end of Bookmarks)
and convert the whole field into a bookmark.

The Problem...

The EditFind command in WordBasic is as follows:


This will find a location that matchs the string exactly. This
works no problem



This happens on any WordBasic command that i try with ny extra
parameters other than the basic command.

Also if a WordBasic command returns a value how do you retrieve

name the bookmark...For Instance:



created.

Help this is driving me nuts

2. How to reduce glare?

3. OLE with word 6.0/2.0

4. Offering Big Bucks for a Heathkit Hero 2000

5. PB 4.0 [Does Datawindow Column Support OLE 2.0]

6. EPOC - Spell possible error

7. (Need Informatin) PB 4.0 - OLE 2.0 support ?

8. OLE 2.0 To MS-Project

9. PB 4.0, Word 6.0a and OLE Automation problem

10. MS-Word OLE events

11. MS-Word OLE question