Hello everyone
Is it possible to insert AutoTexts with Spire.doc? I could not find any references in the documentation.
Thanks and best regards
Paragraph paragraph = section.AddParagraph();
Field field = paragraph.AppendField("Test1", FieldType.FieldAutoText);
field.Code = " AUTOTEXT \" Arrow1 \" \\* MERGEFORMAT ";
Document document = new Document();
Section section = document.AddSection();
Paragraph paragraph = section.AddParagraph();
Field field = paragraph.AppendField("Spike", FieldType.FieldAutoText);
document.SaveToFile("1.dotx",FileFormat.Dotx2010);
Dim objDocument As New Document()
objDocument.LoadFromFile("AutoTextExtension\Dokumente\Can_Add_AutoTextField_To_Paragrapgh.dotx")
Dim objAutoTextExtension As New AutoTextExtension()
Dim paragraph As Paragraph = objDocument.Sections(0).AddParagraph()
paragraph.AppendField("TEST", Spire.Doc.FieldType.FieldAutoText)
objDocument.SaveToFile("AutoTextExtension\Dokumente\Can_Add_AutoTextField_To_Paragrapgh_Run.docx")
Assert.AreEqual("TEST 123", paragraph.Text)