Results 1 to 10 of 10

Thread: Change extension in linked images

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Change extension in linked images

    Hello, is there any way to write a script to change the extensions for linked images in a document? I have around 2000 linked images and I found that I should have had them as jpg files not png files.

    *Edit*
    I found this code that apparently does it for Powerpoints... could someone convert it so it works with word?

    Sub changeLinkTargets()
    
    
    Dim pptSlide As Slide
    Dim pptShape As Shape
    
    
    Dim oldString As String
    oldString = "\\serverXY\DataFiles"
    Dim newString As String
    newString = "\\serverAQ\DataFiles"
    
    
    For Each pptSlide In ActivePresentation.Slides
        For Each pptShape In pptSlide.Shapes
            If pptShape.Type = msoLinkedOLEObject Or pptShape.Type = msoLinkedPicture Then
                With pptShape.LinkFormat
                    If InStr(1, UCase(.SourceFullName), UCase(oldString)) Then
                        .SourceFullName = Replace(.SourceFullName, oldString, newString)
                    End If
                End With
            End If
        DoEvents
        Next pptShape
    DoEvents
    Next pptSlide
    
    
    End Sub
    Found at: https://www.experts-exchange.com/que...owerPoint.html
    Last edited by LibrarianBri; 07-12-2017 at 10:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •