Free Support Forum - aspose.com

Bookmark inserts new line

I am populating a list of bookmarks in a document based on the value of checkboxes on a menu. The bookmarks are populating but the formatting is incorrect. It looks like inserting text at the bookmark also inserts a line feed.

Here's my code:

Dim doc As Document = New Document(DocName)

Dim builder As DocumentBuilder = New DocumentBuilder(doc)

If Me.Checkbox.Checked = True Then

builder.MoveToBookmark("chk01", True, False)

builder.Writeln("X")

End If

Here's what the line ends up looking like in the document:

__X

_ 1. Document Text Here

It should look like this:

__X_ 1. Document Text Here

What am I doing wrong?

Thanks,

Shelley

Hello!<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose.Words.

Please try the same but using another writing method:

builder.Write("X")

Difference between Write and Writeln is that second one adds a new line after the text.

Regards,

Thank you! It works perfectly now.