How to Break links in PowerPoint with PowerShell

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Jairo Martín Miguel Jairo Martín Miguel 5 months, 1 week ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #37968

    Hi all,

    I want to break the links of all the existing linked objects in a Presentation using the following code

    foreach ($Slide in $Presentation.Slides)
    {
    foreach ($Shape in $Slide.Shapes)
    {
    $Shape.LinkFormat.BreakLink()
    }
    }

    An error appears... "This operation
    requires a linked object". I would like to know how I could ask if an Object is a Linked Object before the execution of the function BreakLinks()...

    foreach ($Slide in $Presentation.Slides)
    {
    foreach ($Shape in $Slide.Shapes)
    {
    ———>>> if($Shape "is a Linked Object") {
    $Shape.LinkFormat.BreakLink() }
    }
    }

    Thanks!!!!!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.