We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issues with HTML formatting tags

Hello Team,



Please take a look at the attached document for above mentioned subject.



Best Regards,

Dwarika

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

Thanks for your request. You should use InsertHtml method in this case. Please see the following code:

//Create document and documentbuilder

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

Aspose.Words.Font font;

Paragraph paragraph;

Run run;

//Create new text object of aspose

// reportDocument is the Aspose document object.

run = new Run(doc);

font = run.Font;

paragraph = new Paragraph(doc);

//Add text object to paragraph

paragraph.AppendChild(run);

//Create New Shape as text box

Shape textBox = new Shape(doc, ShapeType.TextBox);

textBox.Width = 100;

textBox.Height = 100;

//Assign paragraph to shape

textBox.AppendChild(paragraph);

//Insert texybox into the document

doc.FirstSection.Body.FirstParagraph.AppendChild(textBox);

//Insert HTML formated text

builder.MoveTo(run);

builder.InsertHtml(" Test Text ");

//Save output document

doc.Save(@"Test072\out.doc");

Also, see the following link to learn more about InsertHtml method.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/aspose.words.documentbuilder.inserthtml.html

Hope this helps.

Best regards.