links in presentation (VBA)

P

pm

hello,

how can i transform links from automatic to manual in slide master view

a code below allows only for transformation in slides (not in slidemaster)

Dim sld As Slide
Dim sh As Shape
For Each sld In ActivePresentation.Slides
For Each sh In sld.Shapes
If sh.Type = msoLinkedOLEObject Then
'Set the link to manual update mode
sh.LinkFormat.AutoUpdate = ppUpdateOptionManual
End If
Next sh
Next sld
 
C

Chirag

The following code will change the links from automatic to manual in slide
master:

---
Function GetSlideMaster(ByVal Sld As Slide) As Master
Dim oSld As Object

If Val(Application.Version) > 9# Then
Set oSld = Sld
If Sld.Layout = ppLayoutTitle Then
Set GetSlideMaster = oSld.Design.TitleMaster
Else
Set GetSlideMaster = oSld.Design.SlideMaster
End If
Else
Set GetSlideMaster = Sld.Master
End If
End Function

Sub ChangeMasterLinksToManual()
Dim Sld As Slide
Dim Shp As Shape
Dim SldMaster As Master

For Each Sld In ActivePresentation.Slides
Set SldMaster = GetSlideMaster(Sld)
For Each Shp In SldMaster.Shapes
If Shp.Type = msoLinkedOLEObject Then
Shp.LinkFormat.AutoUpdate = ppUpdateOptionManual
End If
Next Shp
Next Sld
End Sub
---

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
P

pm

Shyam said:
Check out updated code on this page:
Disable the "Update links" dialog box
http://skp.mvps.org/ppt00029.htm

i use your code to update all links in presentation (in slides and in masters view)

Sub UpdtAll(oSlideOrMaster As Object)

Dim oShp As PowerPoint.Shape
For Each oShp In oSlideOrMaster.Shapes
If oShp.Type = msoLinkedOLEObject Then
'Update links
oShp.LinkFormat.Update
End If
Next oShp

End Sub

but i cannot run this macro (alt+f8 does not show any macro to choose)
 
P

pm

Chirag said:
The following code will change the links from automatic to manual in slide
master:


i use your code as follows:

Function GetSlideMaster(ByVal Sld As Slide) As Master
Dim oSld As Object

If Val(Application.Version) > 9# Then
Set oSld = Sld
If Sld.Layout = ppLayoutTitle Then
(E) Set GetSlideMaster = oSld.Design.TitleMaster
Else
Set GetSlideMaster = oSld.Design.SlideMaster
End If
Else
Set GetSlideMaster = Sld.Master
End If
End Function
Sub UpdtAllLinks()
Dim Sld As Slide
Dim Shp As Shape
Dim SldMaster As Master

For Each Sld In ActivePresentation.Slides
Set SldMaster = GetSlideMaster(Sld)
(E) For Each Shp In SldMaster.Shapes
If Shp.Type = msoLinkedOLEObject Then
Shp.LinkFormat.Update
End If
Next Shp
Next Sld
End Sub

but i get error in function at line with 'titlemaster' (E) (object does not exist)
when i remove this line:

Function GetSlideMaster(ByVal Sld As Slide) As Master
Dim oSld As Object

If Val(Application.Version) > 9# Then
Set oSld = Sld
If Sld.Layout = ppLayoutTitle Then
Set GetSlideMaster = oSld.Design.SlideMaster
End If
Else
Set GetSlideMaster = Sld.Master
End If
End Function

then macro stops with error 91 in Sub -> variable not set..
 
S

Steve Rindsberg

Some presentations have a title master, some don't. It seems that yours doesn't;
that'd explain the sort of errors you're getting.

In your GetSlideMaster function, add another test:

If Sld.Layout = ppLayoutTitle Then
if Sld.Parent.HasTitleMaster Then
Set GetSlideMaster = oSld.Design.TitleMaster
else
Set GetSlideMaster = oSld.Design.SlideMaster
end if
Else
Set GetSlideMaster = oSld.Design.SlideMaster
End If

Make a similar test for versions prior to 10.

The logic is this:

IF the presentation (or design) has a TitleMaster, then PPT uses it for Title
slides. Otherwise it uses the Slide master.
 
S

Shyam Pillai

You have to use the entire macro on the page to enumerate through all the
slides and master or edit the macro accordingly, you can use part of the
macro from the page and except it to run. The invoking macro is UpdateMode.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top