Have a word doc that is created using Aspose.Words and i wanted to add a comment after a particular line in the doc.
For simplicity my code is something like this:
Dim license As Aspose.Words.License = New Aspose.Words.License
license.SetLicense("\\borg\share\Installs\Aspose\Aspose.Words.lic")
Dim doc As Document = New Document()
Dim builder As DocumentBuilder = New DocumentBuilder(doc)
With builder
'Set page margins
.PageSetup.LeftMargin = 72
.PageSetup.RightMargin = 72
.PageSetup.TopMargin = 40
.Writeln()
.Writeln()
.Font.Color = System.Drawing.Color.Blue
.Font.Underline = Underline.Single
.InsertHyperlink("here", "\\lancpa-clu\shared\Case Letters\OpeningExamples.pdf", False)
.Font.Color = System.Drawing.Color.Black
.Font.Underline = Underline.None
Dim c As New Comment(doc)
c.Paragraphs.Add(New Paragraph(doc))
c.FirstParagraph.Runs.Add(New Run(doc, "This is a Test comment."))
.CurrentParagraph.AppendChild(c)
.Writeln()
doc.Save("\\lancpa-clu\Shared\Case Letters\Testing\" & txtFileName.Text.Trim & ".doc")
I get the error on the save. If I take out the comment part it works fine.
What am I doing wrong?
Thanks