Hyperlinks in PowerPoint SmartArt
Timo Koukkari
1
Reputation point
I'm trying to loop all hyperlinks in PowerPoint presentation in Add In application.
It works fine when the hyperlinks are in normal text but when they are in a Smart Art object I get an exception when trying to get the link.
Here is the code that I'm using:
// Get slides collection.
CComPtr< PowerPoint::Slides > spSlides;
pPresentation->get_Slides( &spSlides );
long lCount = spSlides->GetCount();
// Loop through all slides.
for( long lItem = 1; lItem <= lCount; ++lItem )
{
// Get the slide.
CComPtr< PowerPoint::_Slide > spSlide;
spSlides->raw_Item( CComVariant( lItem ), &spSlide );
// Get all hyperlinks from the slide.
PowerPoint::HyperlinksPtr spHyperlinks;
spSlide->get_Hyperlinks( &spHyperlinks );
// Go through the hyperlinks.
long lLinkCount = 0;
hyperlinks.get_Count( OUT &lLinkCount );
for( long lLink = 1; lLink <= lLinkCount; ++lLink )
{
// Get the hyperlink at the index.
CComPtr< PowerPoint::Hyperlink > spHyperlink;
hyperlinks.raw_Item( lLink, &spHyperlink );
The last line throws an exception '0x000000e7 : All pipe instances are busy.' when the hyperlink is in Smart Art object.
Do I have to get those Smart Art link somehow differently?
Thanks,
Timo Koukkari