python-pptx
python-pptx copied to clipboard
Hyperlink Screentip being set, but not showing in Powerpoint
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.
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