Text borders

Hi support,

Can I have borders for a text within a paragraph ? I know how to set the borders for the entire paragraph, but I was wondering if there is any way to do this for some word in the paragraph.

Best regards,
Milan

Hi
Thanks for your inquiry. Yes you can achieve this using Aspose.Words. Please see the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Write text withour borders
builder.Write("This is text without borders");
// Push font
builder.PushFont();
// Set text borders
builder.Font.Border.LineStyle = LineStyle.Single;
builder.Font.Border.LineWidth = 1;
builder.Font.Border.Color = Color.Red;
// Write text with borders
builder.Write("This is text with borders");
// Pop font
builder.PopFont();
// And write text without borders again
builder.Write("This is text without borders");
// Save output document
doc.Save(@"Test137\out.doc");

Hope this helps.
Best regards.