How to set target in link in Aspose words

Hi,

I am using Aspose for document conversion. I have attached a code for html conversion. I need to create a hyperlink that has to open a in new tab

Html:

<a href="https://www.aspose.com/" target="_blank"/>
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.insertHyperlink("Aspose Website", "https://www.aspose.com/", false);
doc.save(getMyDir() + "DocumentBuilder.InsertHyperlink Out.html, SaveFormat.HTML);

Now after conversion if i click link, url is loaded in same page. I need to open it in new page. Please help me.

Regards,
Anbu

Hi Anbu,

Thanks for your inquiry. Sure, you can achieve this by using the following code snippet:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertField(@"HYPERLINK http://www.aspose.com \t _blank", "Aspose Website");
doc.Save(@"C:\Temp\out.html");

Please let me know if I can be of any further assistance.

Best regards,