简体   繁体   中英

Add hyperlink to a slide in the current PowerPoint

I've been searching for this for hours, but could not find appropriate approach to do so. On MSDN, they suggest using Address and SubAddress to locate a slide in a Presentation, but this failed its purpose.

So my question is, how to add a hyperlink to a slide in the same Presentation?

Finally I've figured it out, and since there's lack of resources, I would like to post my solution.

Interestingly, to add a hyperlink to a slide inside the same presentation, you need to leave Address property blank, and set its SubAddress to be a string in a format: "yourSlideID,yourSlideIndex,yourSlideName".

For example, you want to add a hyperlink to a slide with slide ID 256, slide index 1, slide name "Slide 1" , to a shape, do this:

var mouseOnClickAction = shape.ActionSettings[PpMouseActivation.ppMouseClick];

mouseOnClickAction.Action = PpActionType.ppActionNamedSlideShow;
mouseOnClickAction.Hyperlink.Address = null;
mouseOnClickAction.Hyperlink.SubAddress = "256,1,Slide 1";

Hope this helps everybody :D

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM