Hi,
I’m using the Aspose Word Sample projects to test some functions in replacing fields and have come across an issue. Using the attached document with just a FieldTextForm and the following code:
Document doc = new Document(dataDir + "Test In.docx");
FieldsHelper.ConvertFieldsToStaticText(doc, FieldType.FieldFormTextInput);
doc.Save(dataDir + "Test Out.docx");
Causes the following error: “Stack Empty”
Further details:
at System.Collections.Stack.Pop()
at x13cd31bb39e0b7ea.xd8102f3a59d221a1.x9eedad928f98421f(FormField x0ab8fc6e4b8e829c)
at x13cd31bb39e0b7ea.xcc0b5baa75272714.VisitFormField(FormField formField)
at Aspose.Words.Fields.FormField.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Paragraph.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Body.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Section.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Document.Accept(DocumentVisitor visitor)
at x13cd31bb39e0b7ea.xcc0b5baa75272714.x18dfca7c5fd2402f(x8556eed81191af11 x5ac1382edb7bf2c2)
at Aspose.Words.Document.xf381a641001e6830(Stream xcf18e5243f8d5fd3, String xafe2f3653ee64ebc, SaveOptions xc27f01f21f67608c)
at Aspose.Words.Document.Save(String fileName, SaveOptions saveOptions)
at Aspose.Words.Document.Save(String fileName)
at ReplaceFieldsWithStaticText.Program.ConvertFieldsInDocument(String dataDir) in C:\Program Files (x86)\Aspose\Aspose.Words for .NET\Samples\ReplaceFieldsWithStaticText\CSharp\Program.cs:line 169
at ReplaceFieldsWithStaticText.Program.Main(String[] args) in C:\Program Files (x86)\Aspose\Aspose.Words for .NET\Samples\ReplaceFieldsWithStaticText\CSharp\Program.cs:line 29
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Any ideas on how to fix this? I have similar issues with FieldType.FieldFormDropDown
on another document. Running 13.3.0.0 at the moment but I don’t think it’s a version issue.