python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

Hyperlink Screentip being set, but not showing in Powerpoint

Open paulbrazell opened this issue 1 year ago • 1 comments

I have a function that is setting the Hyperlink's screen_tip property:

cell_link = cell.text_frame.paragraphs[0].add_run()
cell_link.text = display_text
hlink = cell_link.hyperlink
hlink.address = url
if screen_tip:
    print(f"Has a screen_tip: {screen_tip}")
    hlink.screen_tip = screen_tip
    print(hlink.screen_tip)

This outputs the correct information when I print the input variable and the hlink.screen_tip, but when I view this in Powerpoint the ScreenTip is not present.

Tested on versions 0.6.22 and 1.0.2. Validating with Powerpoint Version 16.86 on Mac.

Maybe i'm doing something wrong, but seems to be correct per the documentation.

paulbrazell avatar Oct 23 '24 19:10 paulbrazell

After reading "The link XML is not written until .address is specified.", edited the code to the following and i still see the same behavior

cell_link = cell.text_frame.paragraphs[0].add_run()
cell_link.text = display_text
hlink = cell_link.hyperlink
if screen_tip:
    print(f"Has a screen_tip: {screen_tip}")
    hlink.screen_tip = screen_tip
    print(hlink.screen_tip)
hlink.address = url

paulbrazell avatar Oct 23 '24 20:10 paulbrazell