Results 1 to 1 of 1
2013-09-16, 06:52 #1
- Join Date
- Sep 2013
- Thanked 0 Times in 0 Posts
Broken reference from word through VBA
I hm begginerin VBA. I want to remove the broken reference from word documents. I can able to find out number of reference in document including broken reference. but when i try to remove the reference/ get the broken reference name with the following code, I got run time error. I tried with following codes but nothing worked out for me.
Code as follows:
Dim vbProj As VBProject
Dim chkRef As Reference
Dim i as Integer
Set vbProj = ActiveDocument.VBProject
For Each chkRef In vbProj.References
If chkRef.IsBroken Then
Dim Z as object
For Each z In Application.VBE.ActiveVBProject.references
If z.IsBroken = true Then
Set Z = Application.VBE.ActiveVBProject.references.item("P PC")
Whenever the code reaches the broken reference , I got the runtime error (Name, FullPath doent work ). Machine is window s7 64 bit.. word is 32 bit version 2010.
Thanks in advance..