N
N
Nikolai Panteleev2014-06-25 11:54:39
SharePoint
Nikolai Panteleev, 2014-06-25 11:54:39

How to automate the replacement of hyperlinks when transferring documents from a file server to a corporate portal document library on MS SharePoint?

How to automate the replacement of hyperlinks in documents \\server\folder\doc with https://portal.com/DocLib/folder/doc when transferring documents from a file server to a portal document library on MS SharePoint 2013?
There are ~ 65,000 documents on the server - there is no way to manually interrupt them. Perhaps there is special software or friends who can write something similar ...
Any information will help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
caper, 2014-06-25
@caper

Write a document loader that will run through the file storage, open the document, edit links in it, save it, and only after that upload it to the SP library.
In the bootloader adapt this code:

Sub ReplaceHyperlinks()
    Dim HL As Hyperlink
    Dim target As String
    Dim repl As String
    target = InputBox("Find address", "Replace Hyperlink")
    If Len(target) = 0 Then Exit Sub
    repl = InputBox("Replace address", "Replace Hyperlink")
    If Len(repl) = 0 Then Exit Sub
    For Each HL In ActiveDocument.Hyperlinks
        With HL
            If InStr(LCase(.Address), LCase(target)) _
            Or InStr(LCase(.TextToDisplay), LCase(target)) Then
                .Address = Replace(.Address, target, repl)
                .TextToDisplay = Replace(.TextToDisplay, target, repl)
                .ScreenTip = Replace(.ScreenTip, target, repl)
                .Range.Fields.Update
            End If
        End With
    Next
End Sub

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question