Last active
March 7, 2025 10:24
Track Changes in Word using C#. For details: https://kb.aspose.com/words/net/track-changes-in-word-using-csharp/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Aspose.Words; | |
using Aspose.Words.Tables; | |
namespace SimpleTableDocument | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
License lic = new License(); | |
lic.SetLicense("License.lic"); | |
Document wordDoc = new Document(); | |
Table table = new Table(wordDoc); | |
table.EnsureMinimum(); | |
Row row = new Row(wordDoc); | |
table.AppendChild(row); | |
Cell cell = new Cell(wordDoc); | |
row.AppendChild(cell); | |
wordDoc.StartTrackRevisions("The developer", DateTime.Now); | |
Paragraph paragraph = new Paragraph(wordDoc); | |
paragraph.AppendChild(new Run(wordDoc, "Sample text in the table cell.")); | |
cell.AppendChild(paragraph); | |
wordDoc.FirstSection.Body.AppendChild(table); | |
string outputFilePath = "SimpleTableDocument.docx"; | |
wordDoc.Save(outputFilePath); | |
Console.WriteLine("Document with a simple table created successfully: " + outputFilePath); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment