From: confuseddotcom on
Hi,

I'm using XML nodes in Word 2007 and have successfully creating documetns
and updated node values. However on occasion I get an error message stating:

"This predefined bookmark is available for the active document only."

The strange thing is that this only happens intermittently but it is always
when I try to access the node. eg. of code:
Dim DataNodes As Word.XMLNodes
DataNodes = ActiveDocument.SelectNodes("//*", PrefixMapping, True)
For Each n As Word.XMLNode In DataNodes
If n.BaseName Like "FreeText*" Then
n.Range.Editors.Add(Word.WdEditorType.wdEditorEveryone)
End If
Next

This code will error when n.BaseName is called. Again this happens on
occasion so I can't really narrow down why it's happening.
Can anyone help?

Thanks.