In some Word documents I get what look to be broken objects, that is, objects that are not null or nothing but whose members display as “Object has been deleted.” Has anyone else come across these and if so, how can you fix, ovoid or test for them?
For example, in a the code, myRevision is broken although gWordDocument.Revisions(1) is fine.
Dim myRevision As Revision For Each myRevision In gWordDocument.Revisions ‘Assume gWordDocument is valid and gWordDocument.Revisions.count > 0 If myRevision Is Nothing Then ShowObjectError ‘Error notice is never invoked End If Debug.Print myRevision.Author ‘Produces an error: Err = -2147467259/Description: Automation error Unspecified error Next
The attached graphic shows the debug informaiton for the myRevision object and the corresponding Item object in the Revisions tree.