Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerpoint Update Links

Status
Not open for further replies.

rudevincy

Vendor
Feb 7, 2006
4
0
0
US
Hello,

I am trying to write VBA code that allows a user to update links by selecting the file and updating.

This is what I have but some how the link range is changing causing the linked image to be cut in half.

Can someone PLEASE HELP!!

Dim In_file As Variant
Dim dlgOpen As FileDialog
Dim linkpos As Integer
Dim i As Integer
Dim k As Integer
Dim linkname As String

Set dlgOpen = Application.FileDialog(Type:=msoFileDialogOpen)
dlgOpen.AllowMultiSelect = False

For i = 1 To ActivePresentation.Slides.Count

With ActivePresentation.Slides(i)
For k = 1 To .Shapes.Count
With .Shapes(k)

If .Type = msoLinkedOLEObject Then
If dlgOpen.Show = -1 Then
In_file = dlgOpen.SelectedItems.Item(1)
End If

With .LinkFormat

linkpos = InStr(1, .SourceFullName, "!", _
vbTextCompare)

linkname = Right(.SourceFullName, Len(.SourceFullName) - linkpos)
.SourceFullName = In_file & linkname
.AutoUpdate = ppUpdateOptionAutomatic
End With
End If
End With
Next k
End With
Next i

ActivePresentation.UpdateLinks

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top