Re: Forms OLE Automation with Word

From: Jack Ploeg <no email>
Date: Tue, 16 Nov 1999 11:30:27 GMT
Message-ID: <38313a8b.12483557_at_news.logica.co.uk>


Dolf-Jan,

You could use the word editreplace function instead of find and insert. In this editreplace funtion you supply these arguments in an arg-list:

  • text to look for
  • text to replace with
  • search-direction (0 or 1)
  • casesensitivity (0 or 1)
  • 4 other arguments
  • replace all ( 1 = Yes)
  • 2 more arguments

For more information about the exact parameters see thw word-basic help for editreplace.

Good luck

Jack
On Sat, 13 Nov 1999 17:36:44 -0000, "Dolf-Jan Mulder" <djmulder_at_advantage.nl> wrote:

>Hello,
>
>I use the following procedures to exchange data form Forms to Word. The
>problem that occurs that only the first occurence of a variable is replaced.
>I want a 'replace all'. Can somebody point out how to code this?
>procedure EditGoTo (txt in varchar2) is
> arglist ole2.list_type;
>begin
> -- txt is a variable in Forms
> arglist := ole2.create_arglist;
> ole2.add_arg (arglist, '<'||txt||'>');
> ole2.invoke (obj_hnd, 'editfind', arglist);
> ole2.destroy_arglist (arglist);
>end;
>
>procedure InsertText (txt in varchar2) is
> arglist ole2.list_type;
>begin
> -- txt is the value for the variable
> arglist := ole2.create_arglist;
> ole2.add_arg (arglist, txt);
> ole2.invoke (obj_hnd, 'insert', arglist);
> ole2.destroy_arglist (arglist);
>end;
>
>Thanks, Dolf-Jan
>
>
Received on Tue Nov 16 1999 - 12:30:27 CET

Original text of this message