Break links method isn't available in the PowerPoint object
model. It is possible to break links by copying the shape to clipboard and
pasting an image of the linked object using Window API and deleting the
original object. There is also another way around this limitation as shown
in the sample below. The snippet below converts all linked OLE objects into
pictures. It executes the Break links menu item which is available in the
command bar collection to convert an OLE linked shape into a picture.
'
---------------------------------------------------------------------
' Copyright ©1999-2018, Shyam Pillai, All Rights Reserved.
' ---------------------------------------------------------------------
' You are free to use this code within your own applications, add-ins,
' documents etc but you are expressly forbidden from selling or
' otherwise distributing this source code without prior consent.
' This includes both posting free demo projects made from this
' code as well as reproducing the code in text or html format.
' ---------------------------------------------------------------------
Sub BreakLinks() Dim oSld As Slide Dim oShp As
Shape Dim oCmdButton As CommandBarButton Set oCmdButton =
CommandBars("Standard").Controls.Add(ID:=2956) ActiveWindow.ViewType =
ppViewSlide For Each oSld In ActivePresentation.Slides
For Each oShp In oSld.Shapes
If oShp.Type = msoLinkedOLEObject Then
ActiveWindow.View.GotoSlide oSld.SlideIndex
oShp.Select
Application.CommandBars.FindControl(ID:=2956).Execute
' Do not forget to add this line else
you will get erratic
' results since the code execution does not halt while menu
' command is executed hence we have to let the execution
' complete before proceeding.
DoEvents End If
Next oShp Next oSld oCmdButton.Delete End Sub
|