Obtaining a Field reference from a Node

In my application I have a reference to a FieldStart node. Is there anyway of gaining a reference to the encompassing Field object. i.e The facade class that encompasses the FieldStart, Seperator and FieldEnd ?


I can think of a nasty inefficient way to do it. i.e. loop through all the fields in the document and compare the Field.FieldStart to my node, is there a better way ?

I’ve worked it out!


if (node.NodeType == NodeType.FieldStart)
{
FieldStart fieldStart = (FieldStart)node;
Field newField = fieldStart.GetField();
}

Hi Scott,

Thanks for your inquiry. It is nice to hear from you that you have solved your problem. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.