Below is a piece of script which inserts a picture to the slide. I want to add hyperlink to the picture, but it doesn't work.
from pptx import Presentation
import pptx.util
from pptx.util import Inches, Pt
pptfile = r"C:\Users\prashant\NEW - Copy.pptx"
fgr = "gr.png"
prs = Presentation(pptfile)
slides = prs.slides
for slide in prs.slides:
for shape in slide.shapes:
pic = slide.shapes.add_picture(fgr, pptx.util.Inches(1),
pptx.util.Inches(0.2),width=pptx.util.Inches(0.8), height=pptx.util.Inches(0.5))
pic.name = "Picture 999"
for shape in slide.shapes:
if shape.name == "Picture 999":
shape.address = 'https://github.com/scanny/python-pptx'
# shape.hyperlink.address = 'https://github.com/scanny/python-pptx' >>Gives Error
prs.save(pptfile)
print("Done!")
The script runs successfully but the hyperlink is not added to the png image in the presentation file.
Any suggestions??