Fixing Broken References

  • Thread starter Thread starter Tracy Smith
  • Start date Start date
T

Tracy Smith

I have an Application that runs under run-time that uses
Word Automation. I am referencing the Word Object
Library and I'm running into problems if the version of
Word on the user's computer is Word 2000 and I am
developing on my machine which has Word XP. Is there any
way programmatically to fix this based on which version
the user's machine has installed?
 
Tracy:

The rule is, always develop on a PC that has the earliest
version of Word (or any Office App) you want to support.
Then set the Reference to that version- ie.,
Word 2000 = Microsoft Word 9.0 Object library,
Word 2002/XP = [...]10.0[...], etc.
And make sure you don't use any VBA methods/objects etc.
that were added in a later version of the App than the
earliest one you want to support. If you do this, you will
have no problems with References.

The other option is to use Late Binding, but that will
cause a definite performance hit, and I don't recommend it.

-Andrew
======================================
 
Tracy

I used something similar with Excel

Dim excel_app As Excel.Applicatio

excel_app = New Excel.Applicatio
excel_app.Visible = Fals
If Val(excel_app.Application.Version) >= 8 The
' Do somethin
Els
' Do something els
End I

Same should be true with Word.
 
Back
Top