schneidm
01-26-2010, 06:39 PM
I am using this code to remove the links from my master file before saving to a new file. It works well except on the slides where I have two linked objects. It only removes the link on one of the objects on these slides. How can I modify the code to remove ALL links?
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
DoEvents
End If
Next oShp
Next oSld
oCmdButton.Delete
End Sub
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
DoEvents
End If
Next oShp
Next oSld
oCmdButton.Delete
End Sub