In previous versions the Table.Title and Table.TableDescription used to work. Currently, if you save a file with these fields filled in, they are no longer populated when you reload the document.
- Code: Select all
using (Document doc = new Document())
{
doc.CreateMinialDocument();
Table table = doc.Sections[0].AddTable(true);
table.Title = "TableTitleTest";
table.TableDescription = "TableDescriptionTest";
table.ResetCells(2, 2);
doc.SaveToFile("TableTitleTest.docx", FileFormat.Docx2013);
foreach (Section section in doc.Sections)
{
foreach (Table tbl in section.Tables)
{
Debug.WriteLine(tbl.Title ?? "No Title");
Debug.WriteLine(tbl.TableDescription ?? "No TableDescription");
}
}
}
using (Document doc = new Document())
{
doc.LoadFromFile("TableTitleTest.docx");
foreach (Section section in doc.Sections)
{
foreach (Table tbl in section.Tables)
{
Debug.WriteLine(tbl.Title ?? "No Title");
Debug.WriteLine(tbl.TableDescription ?? "No TableDescription");
}
}
}
Thanks,
Mark