Written by Allen Wyatt (last updated April 15, 2023)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365
Ian has many, many documents that include links to other documents. (These are not hyperlinks; they are actual document links in Word.) He needs to break those links, and he knows that he can load the documents and break the links one by one. He wonders, though, if there is a macro available that could go through all the documents in a folder and automatically break all the links within those documents.
Manually, you can break links by following these steps:

Figure 1. The Links dialog box.
The steps are a bit different if you are using Word 2007:
As you can tell, this process is rather labor intensive, particularly if you have lots of documents and each document has multiple links. The labor-intensive nature of the process is why Ian was searching for a way to break the links under control of a macro.
In order to do this in a macro, the macro needs to open each document in the folder, break any links it finds, and then save the document. Figuring out how many documents are in a folder, opening them, and closing them is rather straightforward. If you want to break the links, the macro needs to look through each field in the document and break only those that use the LINK field. The following macro shows how this is done.
Sub RemoveLinks()
Dim fleArray() As String
Dim flCount As Long
Dim k As Long
Dim fle As String
Dim fld As Field
Dim currentFileName As String
Dim docPath As String
Dim bDirty As Boolean
docPath = ActiveDocument.Path & "\"
currentFileName = ActiveDocument.Name
fle = Dir(docPath & "*.doc*")
flCount = -1
ReDim fleArray(0)
Do While fle <> ""
flCount = flCount + 1
ReDim Preserve fleArray(flCount)
fleArray(flCount) = fle
fle = Dir()
Loop
If MsgBox("There are " & flCount + 1 & " files to be processed." _
& vbCrLf & "Do you want to continue?", vbYesNo, "Break links") _
= vbNo Then Exit Sub
For k = 0 To UBound(fleArray)
fle = fleArray(k)
Options.UpdateLinksAtOpen = False
Documents.Open FileName:=docPath & fle
Options.UpdateLinksAtOpen = True
bDirty = False
For Each fld In ActiveDocument.Fields
If fld.Type = wdFieldLink Then
' Uncomment the following if link needs to be updated
' before the link is broken
' fld.LinkFormat.Update
fld.LinkFormat.BreakLink
bDirty = True
End If
Next fld
If bDirty Then ActiveDocument.Save ' Only save if links broken
If ActiveDocument.Name <> currentFileName Then ActiveDocument.Close
Next k
End Sub
Notice the For Each loop that looks at each field (fld) in the Fields collection. It checks to make sure that the field's Type property is equal to wdFieldLink, which means it is a LINK field. If so, the code uses the BreakLink method with the LinkFormat property for the field, effectively removing the link.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (2357) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, and Word in Microsoft 365.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!
Think you might have a corrupt document? There is no easy way to tell if this is the case, but there are some things you ...
Discover MoreWord makes it easy to create a new, blank document. What if you want to create more than one document at a time, however? ...
Discover MoreDo you have documents that seem to be locked when you didn't lock them? There are several possible reasons for this ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments