question

TimoKoukkari-3824 avatar image
0 Votes"
TimoKoukkari-3824 asked ·

Hyperlinks in PowerPoint SmartArt

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




c++
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


It seems that the problem can be also observed using Visual Basic (VBA) as a macro. You can try some similar loops and perform investigations to find an alternative, which are easier in VBA, such as getting slides, then shapes, textframes, textranges, runs or smart art nodes etc. Some articles mention that the links are not accessible in case of smart arts. If you find a solution, convert it to C++.

Or maybe export the presentation as an XML or OpenXML using SaveCopyAs2 function, then get the links from XML.

0 Votes 0 ·

0 Answers