ASkolnick
02-01-2012, 02:41 PM
In previously existing Microsoft Word documents, we have a reference to
a file called Paperport.ocx that we didn't put in there and we don't want.
I have looked up a solution to eliminate bad references:
Sub Remove References
Dim ObjRef as Object
For Each objRef in ActiveDocument.VBProject.References
If (objRef.isbroken) then
activedocument.vbproject.references.remove objref
end if
next
set objref=nothing
End Sub
This solution had been working, but no longer is. The problem is that although it finds the bad reference, it does not know the name of the reference.
If I add a
debug.print. objref.name
the error I get is:
Method 'Name' of object 'Reference' failed.
If I don't get that, the error I get is:
Object Library not registered.
The references loaded are:
VBA
Word 12.0
OLE Automation
Office 12
Forms 2.0
Missing: Paperport Desktop
Normal
Any help is greatly appreciated
a file called Paperport.ocx that we didn't put in there and we don't want.
I have looked up a solution to eliminate bad references:
Sub Remove References
Dim ObjRef as Object
For Each objRef in ActiveDocument.VBProject.References
If (objRef.isbroken) then
activedocument.vbproject.references.remove objref
end if
next
set objref=nothing
End Sub
This solution had been working, but no longer is. The problem is that although it finds the bad reference, it does not know the name of the reference.
If I add a
debug.print. objref.name
the error I get is:
Method 'Name' of object 'Reference' failed.
If I don't get that, the error I get is:
Object Library not registered.
The references loaded are:
VBA
Word 12.0
OLE Automation
Office 12
Forms 2.0
Missing: Paperport Desktop
Normal
Any help is greatly appreciated