Board index » delphi » Word 7.0/Word 8.0 Ole Automation

Word 7.0/Word 8.0 Ole Automation

I have an application that uses Automation to open up an existing word
document and insert DB values into specified bookmarks.  It works fine
in Word 7.0, but now I have to accommodate both versions.  The problem
is that Word 8.0 does not recognize the command "WordApp.EditGoto"
(previously used in 7.0) and this is a known bug by Microsoft.  The work
around that MS suggested is:

  Original 7.0 code that works fine:
    WordApp.EditGoto(BookMark);

  MS suggested fix:
    WordApp.ActiveDocument.Bookmarks(BookMark).Select;
                                     or
    WordApp.WW7_EditGoto "Bookmark"

Neither of the MS suggestions work.  I get the error "Method
ActiveDocument (WW7_EditGoto) not valid for automation".  I have read in
other messages that using Word.Application instead of Word.Basic may be
better??  When I try using Word.Application, this code does not work
(works fine with Word.Basic) : "WordApp.FileOpen(FileName);".  It is
very hard (and frustrating) trying to find any documentation on this
subject.  Any suggestions would greatly be appreciated.

Thanks,
Chris Simpkins

 

Re:Word 7.0/Word 8.0 Ole Automation


Just some general info. Word.Application is new to Word8. If you need
compatibility with earlier releases you will have to test for the running
version of Word, use the old code and add new code for Word8. The
documentation (such as it is) for Word.Application is in vbawrd8.hlp. This
is installed along with Word8, but I've been told that you have to do the
custom installation and specifiy it in order to get it.

--
Gerry Pierce

======================================
When you come to a fork in the road, take it.
                                               - Yogi Berra
======================================

Quote
Chris Simpkins wrote in message <34BCE24D.88DC7...@teknowlogy.com>...
>I have an application that uses Automation to open up an existing word
>document and insert DB values into specified bookmarks.  It works fine
>in Word 7.0, but now I have to accommodate both versions.  The problem
>is that Word 8.0 does not recognize the command "WordApp.EditGoto"
>(previously used in 7.0) and this is a known bug by Microsoft.  The work
>around that MS suggested is:

>  Original 7.0 code that works fine:
>    WordApp.EditGoto(BookMark);

>  MS suggested fix:
>    WordApp.ActiveDocument.Bookmarks(BookMark).Select;
>                                     or
>    WordApp.WW7_EditGoto "Bookmark"

>Neither of the MS suggestions work.  I get the error "Method
>ActiveDocument (WW7_EditGoto) not valid for automation".  I have read in
>other messages that using Word.Application instead of Word.Basic may be
>better??  When I try using Word.Application, this code does not work
>(works fine with Word.Basic) : "WordApp.FileOpen(FileName);".  It is
>very hard (and frustrating) trying to find any documentation on this
>subject.  Any suggestions would greatly be appreciated.

>Thanks,
>Chris Simpkins

Other Threads