在本文中,我们想向您展示 3 种从 Word 文档中的图片中删除超链接的快速方法。
有时,当我们在线复制图片时,会发现它嵌入了超链接。 而在Word文档中,不小心点击图片可能会把你带到图片的网址。 这不仅令人恼火,而且会破坏文档的视觉效果,如下所示:
因此,我们选择去掉图片的超链接,避免出现这种意外的页面跳转。 开始了。
方法 1:从一张图片中删除超链接
- 首先,右键单击图片。
- 然后在上下文菜单上,选择“删除超链接”。
方法二:批量删除文档中所有图片的超链接
有一种方法可以从文档中删除所有超链接。 首先按“Ctrl+A”选择所有内容。 然后你按下“Ctrl+Shift+F9”来杀死所有的超链接。 供您参考,这种方式会清除图片和文本上的所有超链接。 然而,我们的目标是仅从图片中删除超链接。 所以我们将不得不利用宏来完成这项工作。
- 首先,按“Alt+F11”在Word中触发VBA编辑器。
- 然后在编辑器中,单击“普通”项目。
- 接下来在菜单栏上,单击“插入”。
- 然后在下拉菜单中选择“模块”。
- 现在双击该模块以在右侧打开其编码区域并将以下宏粘贴到那里:
Sub RemoveAllHyperlinksFromPicturesInOneDocument()
Dim objInlinePicture As InlineShape
Dim objPicture As Shape
If ActiveDocument.InlineShapes.Count > 0 Then
For Each objInlinePicture In ActiveDocument.InlineShapes
objInlinePicture.Select
While Selection.Hyperlinks.Count > 0
Selection.Hyperlinks(1).Delete
Wend
Next
End If
If ActiveDocument.Shapes.Count > 0 Then
For Each objPicture In ActiveDocument.Shapes
objPicture.Select
While Selection.Hyperlinks.Count > 0
Selection.Hyperlinks(1).Delete
Wend
Next
End If
End Sub
- 最后但并非最不重要的是,单击菜单栏上的“运行”以执行代码。
方法三:批量去除多个文档中图片的超链接
- 首先,将所有目标文件整理到一个文件夹中。
- 然后重复方法2中的步骤安装并运行以下宏:
Sub RemoveAllHyperlinksFromPicturesInMultipleDocuments()
Dim objInlinePicture As InlineShape
Dim objPicture As Shape
Dim StrFolder As String
Dim strFile As String
Dim objDoc As Document
Dim dlgFile As FileDialog
Set dlgFile = Application.FileDialog(msoFileDialogFolderPicker)
With dlgFile
If .Show = -1 Then
StrFolder = .SelectedItems(1) & "\"
Else
MsgBox ("No Folder is selected!")
Exit Sub
End If
End With
strFile = Dir(StrFolder & "*.doc*", vbNormal)
While strFile <> ""
Set objDoc = Documents.Open(FileName:=StrFolder & strFile)
Set objDoc = ActiveDocument
If ActiveDocument.InlineShapes.Count > 0 Then
For Each objInlinePicture In ActiveDocument.InlineShapes
objInlinePicture.Select
While Selection.Hyperlinks.Count > 0
Selection.Hyperlinks(1).Delete
Wend
Next
End If
If ActiveDocument.Shapes.Count > 0 Then
For Each objPicture In ActiveDocument.Shapes
objPicture.Select
While Selection.Hyperlinks.Count > 0
Selection.Hyperlinks(1).Delete
Wend
Next
End If
objDoc.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
objDoc.Save
strFile = Dir()
Wend
End Sub
- 在打开的“浏览”窗口中,选择您在步骤 1 中设置的文件夹,然后单击“确定”继续。
谨慎操作Word
Word 并非万无一失,因此任何错误的操作都可能很容易引发崩溃或更糟,从而导致文档损坏。 在您可以更加注重自己的操作技巧和习惯的同时,您也可以购买实用工具 文档恢复 预先。
作者简介:
Vera Chen 是一位数据恢复专家 DataNumen, Inc.,它是数据恢复技术领域的世界领先者,包括 恢复 xls 和 pdf 修复软件产品。 欲了解更多信息,请访问 datanumen.com



