SelectedNodes is pulling some of the merge fields truncated. We are using Aspose.Word 10.5.0.0. I wrote a test program:
void Main(string[] args)
{
Document d = new Document(@"C:\Users\qchy\Desktop\CLOSE_LTR.docx");
NodeList nList = d.SelectNodes("//FieldStart");
foreach(Node field in nList)
Console.WriteLine(field.NextSibling.Range.Text);
Console.WriteLine();
// // another approach
NodeCollection collect = d.GetChildNodes(NodeType.FieldStart, true);
foreach(FieldStart start in collect)
Console.WriteLine(start.NextSibling.Range.Text);
Console.ReadLine();
}
The resulting output shows that some of the fields are truncated:
MERGEFIELD TableStart:CRMTask \* MERGEFORMAT
MERGEFIELD TaskCategoryCodeMergableField \* MERGEFORMAT
MERGEFIELD TaskTypeCodeMergableField \* MERGEFORMAT
MERGEFIELD TaskIdMergableField \* MERGEFORMAT
MERGEFIELD CRMTaskSubjectMergableField \* MERGEFORMAT
MERGEFIELD CRMTaskIdBarcodeMergableField \* MERGEFORMAT
MERGEFIELD CRMTaskResultCodeMergableField \* MERGEFORMAT
MERGE
MERGEFIELD TableStart:IMergableAsset \* MERGEFORMAT
MERGEFIELD LatitudeMergableField \* MERGEFORMAT
MERGEFIELD GISXMergableField \* MERG
MERGEFIELD GISYMergableField \* MERGEFORMAT
MERGEFIELD GISZMergableField \* MERGEFORMAT
MERGEFIELD LocationIdMergableField \* MERGEFORMAT
MERGEFIELD A
MERGEFIELD GISReferenceIDMergableField \* MERGEFORMAT
MERGEFIELD GISSpatialReferenceIDMergableField \* MERGEFORMAT
MERGEFIELD TableEnd:IMergableAsset \* MERGEFORMAT
MERGEFIELD TableStart:CRMTask \* MERGEFORMAT
MERGEFIELD TaskCategoryCodeMergableField \* MERGEFORMAT
MERGEFIELD TaskTypeCodeMergableField \* MERGEFORMAT
MERGEFIELD TaskIdMergableField \* MERGEFORMAT
MERGEFIELD CRMTaskSubjectMergableField \* MERGEFORMAT
MERGEFIELD CRMTaskIdBarcodeMergableField \* MERGEFORMAT
MERGEFIELD CRMTaskResultCodeMergableField \* MERGEFORMAT
MERGE
MERGEFIELD TableStart:IMergableAsset \* MERGEFORMAT
MERGEFIELD LatitudeMergableField \* MERGEFORMAT
MERGEFIELD GISXMergableField \* MERG
MERGEFIELD GISYMergableField \* MERGEFORMAT
MERGEFIELD GISZMergableField \* MERGEFORMAT
MERGEFIELD LocationIdMergableField \* MERGEFORMAT
MERGEFIELD A
MERGEFIELD GISReferenceIDMergableField \* MERGEFORMAT
MERGEFIELD GISSpatialReferenceIDMergableField \* MERGEFORMAT
MERGEFIELD TableEnd:IMergableAsset \* MERGEFORMAT
I attached the file with the issue.
Thanks in advance,
Chi Ho Yeung