Microsoft Word 10.0 object library

B

Bob Lay

Our organization recently did an upgrade of the Office
suite from 97 to XP. The upgrade went well and the
majority of the Access databases converted fine to the
Access 2000 format. We have a database that seems to have
converted properly but is giving us trouble with a Word
10.0 object library reference. The database that is giving
us problems errors out when trying to run the following
statement "Application.Selection.Find.Text = strField",
the error message states that this is an Invalid procedure
call. I had one of our Software Engineers debug the
database and they stated that this command should work
with the Microsoft Word 10.0 object library reference. To
further troubleshoot the problem, I removed the Microsoft
Word 10.0 object library reference and added the Microsoft
Word 8.0 object library reference. After this change, the
database function perfect and I felt that I could copy the
Microsoft Word 8.0 object library (msword8.olb) to each
workstation and everything would be fine. Unfortunately
the workstations are still trying to use the Microsoft
Word 10.0 object library (msword.olb) and there is no sign
of the Microsoft Word 8.0 object library when scrolling
through the list of references.

My question: Once a reference is added to a database, in
my case a reference to Microsoft Word 8.0 object library,
shouldn't this reference appear the same on every
workstation that opens the database, especially if the
actual library is physically in the same location on each
workstation? Is there a way to register object libraries
similar to registering .dll's, so Access 2002 knows that
the library exists? Is there known problems with the
Microsoft Word 10.0 object library and a possible fix? I
would hate to have to open this database from every
computer (350) to make this database function properly.

Thanks,
Bob Lay
 
G

GreySky

I've also looked in the object library, and can see
nothing wrong with your calling convention.

I might suggest making a little Word "macro" with your
code, and execute it directly from Word to see if you can
obtain a more helpful error message. If it works there, I
see no reason for COM to fail.

I *strongly* do not recommend you do what you are
proposing, specifically copying and registering the Word 8
OLB on other computers. The earlier object libraries are
for earlier versions of MS Word (in fact, they *are* the
earlier version components). I would imagine you have two
versions of MS Word loaded on your test box (the one where
you are obtaining both OLB's).

I suggest debugging your current system.

David Atkins, MCP
 
A

Albert D. Kallal

I had one of our Software Engineers debug the
database and they stated that this command should work
with the Microsoft Word 10.0 object library reference.

I would make sure you get a refund on any company time that the above person
spent looking at your problem. For any competent software developer to
suggest keeping references and not to use late binding in these cases is
sheer incompetence (you are not getting any value from that software
person). I guess the software industry is not like a hospital were mixing up
drugs or not cleaning medical equipment is grounds for dismissal. However,
our IT industry really is lacking some professionalism here.

Word 8.0 object library reference. After this change, the
database function perfect and I felt that I could copy the
Microsoft Word 8.0 object library (msword8.olb) to each
workstation and everything would be fine.

I can't imagine anyone even beginning to suggest that one part, or one piece
of a old office library be introduced into brand new pc's with a never
version of office. That could cause all kind of problems and increase
support issues for office. A pc is comprised of thousands of inter-depending
dll's. Simply introducing one dll into a computer can cost a company huge
amounts in wasted support dollars. You could actually wind up damaging the
operation or stability of the new office system. I would fire any IT person
who would suggest that installing a old dll from a old version of office to
fix a simple reference problem as yours. Further, to risk polluting a new
version of office with some old library is just asking for huge trouble (how
do you know what else will, or will not break as a result of your actions?).
If your company does not follow very STRICT versioning of dll's and does not
have a strict policy on the install of ANY dll or software, then your
company is wasting HUGE amounts of support dollars on a yearly basis (I seen
companies that have less support costs per 25 computers then costs per 5
computers when good policies are followed).

The 2nd problem here is you are trying to implement a cure that is much
worse then finding solution. I have no idea why the word 10 library does not
work, but I would certainly test your code, and mdb file on ANOTHER pc with
the word office 10 library. I would also assume you always distribute mde
file to your users...right?

You certainly could test on a new pc and remove the office references, and
then do a de-compile. It is very possible that your development pc has tons
of software and stuff that the production pc's don 't have. You can
certainly try and set the word 10 library ref, and then do a save and
compile all. However, as mentioned, you SHOULD NOT have a reference to the
word library when you start disturbing your application to your users. (you
need to use late binding, and there is not a developer on planet would
suggest otherwise).

Try downloading my sample word merge code at:

http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html

It will work regardless of what version of office you have installed. If
fact, you can even mix versions of access and word, and it still works.
Further, take some time to read ALL of the notes on my web site as to how to
get some reliability in your word automation code. You can read those notes
that start half way down at:

http://www.attcanada.net/~kallal.msn/wordmerge/page2.html

At any rate, you need to switch your code to late binding *right* before you
distribute it, and that means you need to remove any references to the word
library.
 
D

david epsom dot com dot au

statement "Application.Selection.Find.Text = strField",


An Access application does not have a Selection Method or
Property. Obviously, you meant
"MyWordApplicationObject.Selection..."

But now I'm wondering if your code has the same
confusion as your message?

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top