Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2004

Tip: Looking for answers? Try searching our database.

Help: Cross-Version Word Object Library problems (9.0, 10,0, 11.0)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Loveless - 26 Jul 2004 16:27 GMT
I'm working in-house on an Access application to which I've recently
added automatic fill-out-the-form functionality.  The problem: I'm in
a mixed version environment in regards to Office - some machines are
at Word 9.0 Object Lib, two at Object Lib Word 10.0 and the boss and
myself at Object Lib 11.0.  I put the Word 9.0 object library on my
machine (which has Office 2003 installed) and linked to that; that
works fine application-wise - I'm not doing anything close to needing
more Word functionality than that provides - but as best I can tell
whenever I save my version the Reference reverts back to Word Object
11.0, so everytime I send out a new release, which may be a couple of
times a day for misc odds-and-ends fixes, most of the machines in the
office choke, requiring manual intervention on my part to reset the
Reference to whatever they have on their machine.

Is there either

1) Ideal solution I don't expect: A meta-object reference that will
happily use whatever Word object library is present on the current
machine

or

2) a way to force the application to stick to a given Object Library?

I'm going to have the same issue soon with the Outlook lib.

Any help greatly appreciated.  TIA

Mark Loveless
Reluctant Access Programmer
mark.loveless@pmilends.com
Jezebel - 26 Jul 2004 23:03 GMT
The basic technique is:

1. Develop your application for the lowest common denominator (ie Word 9, as
you are doing), and

2. Use late binding.

During development add the Word library as a project reference and declare
it using something like

Dim WordApp as Word.Application
Set WordApp = new Word.Application

Then before distribution, remove the Word library reference and change the
declaration to

Dim WordApp as Object
Set WordApp = GetObject("Word.Application")

You can use late binding during development if you wish; but you get no
intellisense help or syntax checking on the Word object.

> I'm working in-house on an Access application to which I've recently
> added automatic fill-out-the-form functionality.  The problem: I'm in
[quoted text clipped - 27 lines]
> Reluctant Access Programmer
> mark.loveless@pmilends.com
Howard Kaikow - 27 Jul 2004 16:28 GMT
If you develop using the earliest version of Word, then you should  use
early, not late, binding.

Signature

http://www.standards.com/; See Howard Kaikow's web site.

> The basic technique is:
>
[quoted text clipped - 49 lines]
> > Reluctant Access Programmer
> > mark.loveless@pmilends.com
Jezebel - 27 Jul 2004 22:53 GMT
Howard, perhaps you didn't read the original post. The OP's problem is
precisely that early binding isn't appropriate in this case. Unless you're
suggesting that the OP install the Word 9 library on all machines?

Code developed for Word 9 is upward compatible, so by using late binding the
app will function happily with those users who have later versions.

> If you develop using the earliest version of Word, then you should  use
> early, not late, binding.
[quoted text clipped - 53 lines]
> > > Reluctant Access Programmer
> > > mark.loveless@pmilends.com
Howard Kaikow - 28 Jul 2004 09:02 GMT
You only need Word 97 (which is Word 8, not Word 9) on the development
system.
When you compile with Word  97, later versions of Word will automatically
use the correct library, so early binding should be used.

For example, see the following which was compiled using Word 97.
http://www.standards.com/OhMyWord/SetReferenceInWordProject.html

Signature

http://www.standards.com/; See Howard Kaikow's web site.

> Howard, perhaps you didn't read the original post. The OP's problem is
> precisely that early binding isn't appropriate in this case. Unless you're
[quoted text clipped - 63 lines]
> > > > Reluctant Access Programmer
> > > > mark.loveless@pmilends.com
Jezebel - 30 Jul 2004 03:57 GMT
We must be thinking of different things. If you add Word.9 as a reference to
your project and create an early-bound object, it will fail if the user has
(eg) Word.10. Late binding avoid this problem.

> You only need Word 97 (which is Word 8, not Word 9) on the development
> system.
[quoted text clipped - 78 lines]
> > > > > Reluctant Access Programmer
> > > > > mark.loveless@pmilends.com
Howard Kaikow - 30 Jul 2004 10:51 GMT
If you use version N as a reference, the code will work with any later
version.
I do this often.

Signature

http://www.standards.com/; See Howard Kaikow's web site.

> We must be thinking of different things. If you add Word.9 as a reference to
> your project and create an early-bound object, it will fail if the user has
[quoted text clipped - 94 lines]
> > > > > > Reluctant Access Programmer
> > > > > > mark.loveless@pmilends.com
Jezebel - 31 Jul 2004 01:21 GMT
Well done! You've caught the drift.

> If you use version N as a reference, the code will work with any later
> version.
[quoted text clipped - 108 lines]
> > > > > > > Reluctant Access Programmer
> > > > > > > mark.loveless@pmilends.com
Howard Kaikow - 31 Jul 2004 09:47 GMT
Yes, but I'm talking about early, not late binding.

Signature

http://www.standards.com/; See Howard Kaikow's web site.

> Well done! You've caught the drift.
>
[quoted text clipped - 118 lines]
> > > > > > > > Reluctant Access Programmer
> > > > > > > > mark.loveless@pmilends.com
Mark Loveless - 27 Jul 2004 23:04 GMT
Thanks.  I had been working at it backwards, thinking I would have to
read the registry to get the explicit class and create that, when it
hit me that the CreateObject wasn't be flagged as an error (and was in
fact already doing what I was thinking I had to do manually , i.e.
reading the class from the registry to find the appropriate DLL) but
the object declaration, just as you note.  I tried it as with appWord
declared as Object rather than Word.Application, and once I cleaned up
the constants (e.g. wdDoNotSaveChanges), it compiled OK.  After
reading your comments I see I'm on the right track now, and will use
method 2 - develop with the explicit declaration and distribute
without.

As I expected, just cluelessness on my part.  Thanks much.

> The basic technique is:
>
[quoted text clipped - 49 lines]
> > Reluctant Access Programmer
> > mark.loveless@pmilends.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.