This bit of code works with old Word libraries.
Not sure about the VBA Extensibility 5.3.

Sub ActivateWordLibrary()

Dim r

On Error Resume Next

'no need to carry on if the Word Object Library is already there
'---------------------------------------------------------------
For Each r In ThisWorkbook.VBProject.References
If r.GUID = "{00020905-0000-0000-C000-000000000046}" Then
Exit Sub
End If
Next

'Will this work with any Word version from 97 upwards?
'-----------------------------------------------------
'hopefully it will by doing Major:=0, Minor:=0
'Word 2002 is Major:=8, Minor:=2
'Word 2003 is Major:=8, Minor:=3
'-----------------------------------------------------
ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{00020905-0000-0000-C000-000000000046}", _
Major:=0, Minor:=0

On Error GoTo 0

End Sub

Note that this for an Excel .xla add-in and that is why it is ThisWorkbook
and not ActiveWorkbook.


RBS



"VanS" <VanS@discussions.microsoft.com> wrote in message
news:F16F9C1B-B545-442C-A09F-1FDD05B85ABF@microsoft.com...
> Hello,
> I have a VB6/MS Office Excel/Word VBA app configured in Win XP Office
> 2003.
> I am trying to make it compatible with earlier versions of Office-Office
> 97
> on a Win 98 platform at present-and after researching have decided to try
> late binding. According to MS documentation, the application should update
> its references when opened in the earlier Office 97 version. It has done
> this
> for 6 of 8 references: except for the MS Word reference-it is still
> looking
> for Word 11.0 in the same location as was on the original, newer platform.
> Then it is also looking for the MS VBA Extensibility 5.3 file in the
> location
> of the original, newer platform as well.
>
> Does anyone have an idea how I can get my app to point to the correct 2
> references per above? Also should the Extensibility reference be to the
> newer
> 5.3 version (vbe6ext.olb) which per KB article 269116 is a replacement for
> the earlier older type library (which I am guessing is vbeext1.olb as that
> is
> what I find on my Office 97 platform);and if so 1) should I add that to my
> installer application. 2) how do I get it to point to the correct
> location?
> Will I need to use code to locate and set the reference to the file?
> Thanks, blessings
> Van
>