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

Free Support Forum - aspose.com

Hyperlink doesn't work for word document

Hi Team,

When I generate a word document with hyperlink, the link doesn’t work. When I edit the hyperlink, I see # prefixed to the hyperlink URL.

I tested this on Aspose.Words For Java 14.5. The same works as expected with Aspose 13.5.

Thanks,
Kumar

public static void main(String[] args) throws Exception
{
Utils.setupLicense();
Utils.printAsposeVersion();
Document doc = new Document();
DocumentBuilder docBuilder = new DocumentBuilder(doc);

// Specify font formatting for the hyperlink.
docBuilder.getFont().setColor(Color.BLUE);
docBuilder.getFont().setUnderline(Underline.SINGLE);
// Insert the link.
docBuilder.insertHyperlink(“W3”, “http://w3.com”, false);

doc.save(“C:\test_old.doc”);
doc.save(“C:\test_old.pdf”);

System.out.println(“done”);
}

Hi Kumar,

Thanks for your inquiry. This issue has been fixed in latest version of Aspose.Words for Java 14.9.0. Please use Aspose.Words for Java 14.9.0 and let us know if you have any more queries.