Board index » delphi » OLE D3 Word 97

OLE D3 Word 97

I've used D2 and word 97 with OLE succesfully in the past.
Now, using D3, the following doesn't work

procedure ..............
var
    v as variant;
begin
    v:= CreateOLEObject('Word.Basic');
    v.FileNew('c:\template.dot');
    v.GotoBookmark('Bookmark1');
    .
    .
    .
end;

The error is that the OLE Server doesn't support the GotoBookmark function.
However, I can't find the 'new' gotobookmark command.

I have tried a number of other functions, Goto (Bookmark := 'Bookmark1')
but to no avail.

Does anyone have an answer?

TIA
Paul Coombs

 

Re:OLE D3 Word 97


Paul,

The objects Microsoft wants you to use with Word 97 are Word.Application and
Word.Document. If you must use Word.Basic, then the GotoBookmark function
has been renamed to WW7_GotoBookmark to indicate that it is now an obsolete
call and may not exist in Word 9 or later. If a function call does not seem
to work in Word 8, prepend WW7_ to the front of it and it may still be
usable.

--
Ken Rachynski
krac...@cadvision.com
http://www.cadvision.com/krachyn

Quote
Paul Coombs wrote in message <6bvdhs$ml...@plug.news.pipex.net>...
>I've used D2 and word 97 with OLE succesfully in the past.
>Now, using D3, the following doesn't work

>procedure ..............
>var
>    v as variant;
>begin
>    v:= CreateOLEObject('Word.Basic');
>    v.FileNew('c:\template.dot');
>    v.GotoBookmark('Bookmark1');
>    .
>    .
>    .
>end;

>The error is that the OLE Server doesn't support the GotoBookmark function.
>However, I can't find the 'new' gotobookmark command.

>I have tried a number of other functions, Goto (Bookmark := 'Bookmark1')
>but to no avail.

>Does anyone have an answer?

>TIA
>Paul Coombs

Other Threads