C
Chuck
I have a database which will be used by people using Office 2000 or Office
XP. The database requires one of the following libraries depending which
version of Office is used:
Office 2000: Microsoft Word 9.0 Object Library
Office XP: Microsoft Word 10.0 Object Library
Now only one of the above libraries can be referenced at one time so I need
to have code that will add the correct one. This works fine.
I also need to be able to check for broken references and remove them if
required. That is turning out to be a problem.
If the database is referencing the Word 10.0 library but it is being used in
an Office 2000 environment, that libary is broken and I need to remove it.
I am trying this code:
Dim refitem As Reference
For Each refitem In Application.References
If refitem.IsBroken Then Application.References.Remove refitem
Next refitem
In an Office 2000 environment, when it reaches the broken Word 10.0
reference I get this error:
Run-time error '-2147319779 (8002801d)':
Object Library Not Registered
Obviously the broken reference is not removed. Anyone has a solution to
this?
Thanks
XP. The database requires one of the following libraries depending which
version of Office is used:
Office 2000: Microsoft Word 9.0 Object Library
Office XP: Microsoft Word 10.0 Object Library
Now only one of the above libraries can be referenced at one time so I need
to have code that will add the correct one. This works fine.
I also need to be able to check for broken references and remove them if
required. That is turning out to be a problem.
If the database is referencing the Word 10.0 library but it is being used in
an Office 2000 environment, that libary is broken and I need to remove it.
I am trying this code:
Dim refitem As Reference
For Each refitem In Application.References
If refitem.IsBroken Then Application.References.Remove refitem
Next refitem
In an Office 2000 environment, when it reaches the broken Word 10.0
reference I get this error:
Run-time error '-2147319779 (8002801d)':
Object Library Not Registered
Obviously the broken reference is not removed. Anyone has a solution to
this?
Thanks