Free Support Forum - aspose.com

Tooltip for hyperlink

Dear experts,

I am using aspose word api to insert values in my word template. Methods are written in Java. Kindly let me know if I can insert Tooltip for my hyperlink.

code that I have used is following:

builder.getFont().setColor(Color.BLUE);
builder.getFont().setUnderline(Underline.SINGLE);
String url = generateDRL(dfSession, rObjectId);
// Insert the link.
builder.insertHyperlink(“Click here to see attachement :” + rObjectName, url, false);
// Revert to default formatting.
builder.writeln();

Thanks & Regards
Vikas Gupta

Hi

Thanks for your request. You can use code like the following to insert a hyperlink with tool-tip:

builder.pushFont();

builder.getFont().setStyleIdentifier(StyleIdentifier.HYPERLINK);

builder.insertField("HYPERLINK \"http://www.aspose.com\" \\o \"This is a tooltip\"", "Aspsoe web site");

builder.popFont();

Hope this helps.

Best regards,

Hello,

Thanks for your response. I can see tooltip “http://www.aspose.com” but this is actual link that is used in Hyperlink.

Please let me know how I can add a message as my tooltip. Message should be in red and bold.

Thanks for your quick response.

Regards
Vikas Gupta

Hi,

One more thing I missed to explain that I am saving document as PDF.

Thanks & Regards
Vikas Gupta

Hi Vikas,

Thanks for your inquiry.

I have tested the code posted by Alexey and the link in the generated document has a tooltip as expected. Are you able to see this tooltip when you open the document in MS Word?

Also please note that you cannot format a tooltip and that it appears that such tooltips do not appear in output PDF when viewing in Adobe Acrobat

Thanks,