On the topic of Python PPTX Internal Hyperlink
Is there a way to create Hyperlinks prior to creating the slides that they will be linked to?
E.g. create a table of contents slide with hyperlinks to the slides that will be added later, the number of slides wont always be the same as it will be edited by the user.
Interesting question. Here's what I found working with a currently selected shape on a slide. I expect you'd be applying hyperlinks to a textrange instead, but the general idea's the same.
A hyperlink to another slide contains no .Address and the .SubAddress looks like:
SlideID,SlideIndex,SlideTitle
SlideTitle can be blank, so I tested with this to link to a third slide that wasn't there:
Activewindow.Selection.ShapeRange(1).ActionSettings(1).Hyperlink.subaddress = ",3,"
No errors, but the link doesn't work either.
This DOES work, however:
Activewindow.Selection.ShapeRange(1).ActionSettings(1).Hyperlink.subaddress = "258,3,"
I run this on a selected shape on the first slide then later add a third slide and the link jumps to it.
The trick then becomes: How will you know what the SlideID will be, this slide you haven't yet added? In a new presentation, PPT will give the first slide an ID of 256 and increment the ID for each new slide you add, but it'll be quite tricky to keep track of SlideIDs and SlideIndexes if you're adding new slides at random places in a presentation, that may have had slides added and deleted beforehand.
Personally, I think I'd add blank slides ahead of time, link to them, then add whatever content's necessary.