Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2018, 01:00 PM
macareno macareno is offline Edit multiple external weblinks in Power Point Windows 10 Edit multiple external weblinks in Power Point Office 2010 64bit
Novice
Edit multiple external weblinks in Power Point
 
Join Date: Jun 2018
Location: Mexico
Posts: 4
macareno is on a distinguished road
Exclamation Edit multiple external weblinks in Power Point

Hi Guys

Hope some body can help me

I have about 500 power point files, most of them has weblinks that are pointing to other PDF files in a specific web server.
All these web links i had made manually

Now the web server adress is going to change (example):
OLD) http://domain.com/documents/file.pdf
NEW) http://domainnew.com/documents/file.pdf



I have seen that may be is possible using a macro, but i need the help and support from the experts like you because iam not an expert.

Best regards
Reply With Quote
  #2  
Old 06-15-2018, 12:38 AM
JohnWilson JohnWilson is offline Edit multiple external weblinks in Power Point Windows 7 64bit Edit multiple external weblinks in Power Point Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

This is just off the top of my head and untested so use with caution on a copy. Obviously change the server addresses.

Code:
Sub changeLinks()

Dim ohl As Hyperlink
Dim osld As Slide
Const serverold As String = "http://www.technologytrish.co.uk"
Const servernew As String = "http://www.whatever.com"
For Each osld In ActivePresentation.Slides
For Each ohl In ActivePresentation.Slides(1).Hyperlinks
If ohl.Address Like serverold & "*" & ".pdf" Then
ohl.Address = Replace(ohl.Address, serverold, servernew)
End If
Next ohl
Next osld
End Sub
If you put all the files in a single folder it would be possible to adapt this to change all the presentations in one go. There is sample code on www.pptfaq.com
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials

Last edited by JohnWilson; 06-15-2018 at 03:10 AM.
Reply With Quote
  #3  
Old 06-18-2018, 07:38 AM
macareno macareno is offline Edit multiple external weblinks in Power Point Windows 10 Edit multiple external weblinks in Power Point Office 2010 64bit
Novice
Edit multiple external weblinks in Power Point
 
Join Date: Jun 2018
Location: Mexico
Posts: 4
macareno is on a distinguished road
Smile

Thanks a lot

Works so fine, it change all the weblinks in the 1st Slide

I had tested in a power point file with 8 slides, but it change all the weblinks just for the 1st slide, the others 7 remain with the old link

How would be to make the same for the rest of the slides?

Best regards
Reply With Quote
  #4  
Old 06-18-2018, 07:46 AM
JohnWilson JohnWilson is offline Edit multiple external weblinks in Power Point Windows 7 64bit Edit multiple external weblinks in Power Point Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Sorry there's a typo!

Code:
Sub changeLinks()

Dim ohl As Hyperlink
Dim osld As Slide
Const serverold As String = "http://www.technologytrish.co.uk"
Const servernew As String = "http://www.whatever.com"
For Each osld In ActivePresentation.Slides
For Each ohl In osld.Hyperlinks
If ohl.Address Like serverold & "*" & ".pdf" Then
ohl.Address = Replace(ohl.Address, serverold, servernew)
End If
Next ohl
Next osld
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #5  
Old 06-18-2018, 08:13 AM
macareno macareno is offline Edit multiple external weblinks in Power Point Windows 10 Edit multiple external weblinks in Power Point Office 2010 64bit
Novice
Edit multiple external weblinks in Power Point
 
Join Date: Jun 2018
Location: Mexico
Posts: 4
macareno is on a distinguished road
Default

Beautiful ! works and i had resolved my issue

Thanks a lot... (iam lerning so much)
Reply With Quote
  #6  
Old 08-14-2018, 03:19 PM
macareno macareno is offline Edit multiple external weblinks in Power Point Windows 10 Edit multiple external weblinks in Power Point Office 2010 64bit
Novice
Edit multiple external weblinks in Power Point
 
Join Date: Jun 2018
Location: Mexico
Posts: 4
macareno is on a distinguished road
Exclamation

Now iam in the same situation but in this time is an Excel File with hundred of weblinks, how or what would be the macro to change in one hit?

Thanks in advance

Quote:
Originally Posted by JohnWilson View Post
This is just off the top of my head and untested so use with caution on a copy. Obviously change the server addresses.

Code:
Sub changeLinks()

Dim ohl As Hyperlink
Dim osld As Slide
Const serverold As String = "http://www.technologytrish.co.uk"
Const servernew As String = "http://www.whatever.com"
For Each osld In ActivePresentation.Slides
For Each ohl In ActivePresentation.Slides(1).Hyperlinks
If ohl.Address Like serverold & "*" & ".pdf" Then
ohl.Address = Replace(ohl.Address, serverold, servernew)
End If
Next ohl
Next osld
End Sub
Reply With Quote
  #7  
Old 08-14-2018, 10:11 PM
JohnWilson JohnWilson is offline Edit multiple external weblinks in Power Point Windows 7 64bit Edit multiple external weblinks in Power Point Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Not really tested but it should look like:

Code:
Sub loop_Links()

Const serverold As String = "http://www.technologytrish.co.uk"
Const servernew As String = "http://www.whatever.com"
Dim lnk As Hyperlink
Dim L As Long
For L = 1 To ActiveWorkbook.Sheets.Count
For Each lnk In Sheets(L).Hyperlinks
    If lnk.Address = serverold Or lnk.Address = serverold & "/" Then
    Debug.Print lnk.Address & " " & lnk.Range
    lnk.Address = Replace(lnk.Address, serverold, servernew)
    If LCase(Left(lnk.Range, 4)) = "http" Then
    lnk.Range = Replace(lnk.Range, serverold, servernew)
    Else
    lnk.Range = Replace(lnk.Range, Mid(serverold, 8), Mid(servernew, 8))
    End If
    End If
Next lnk
Next L
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials

Last edited by JohnWilson; 08-19-2018 at 03:46 AM.
Reply With Quote
Reply

Tags
edit, power point, weblink

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Power point Gyroman PowerPoint 0 08-08-2015 04:59 PM
can power point LINK to embedded object in power point ? johnseito PowerPoint 0 05-24-2014 04:31 AM
Microsoft Power Point 2004 to Office Power Point 2007 chuff PowerPoint 0 03-20-2011 01:23 PM
Power Point on the Web Carthalion PowerPoint 0 03-03-2010 09:59 AM
power point ladonna12 PowerPoint 2 02-16-2009 09:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft