0% found this document useful (0 votes)
21 views2 pages

Remove Hyperlinks From Multiple Pictures

This document provides 3 methods for removing hyperlinks from pictures in Word documents: 1. The first method removes hyperlinks from all pictures and text using keyboard shortcuts. 2. The second method uses a VBA macro to selectively remove hyperlinks from only pictures in the active document. 3. The third method expands the macro to remove hyperlinks from pictures in multiple documents by selecting a folder of documents and running the macro on each one.

Uploaded by

Suhas Saptak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

Remove Hyperlinks From Multiple Pictures

This document provides 3 methods for removing hyperlinks from pictures in Word documents: 1. The first method removes hyperlinks from all pictures and text using keyboard shortcuts. 2. The second method uses a VBA macro to selectively remove hyperlinks from only pictures in the active document. 3. The third method expands the macro to remove hyperlinks from pictures in multiple documents by selecting a folder of documents and running the macro on each one.

Uploaded by

Suhas Saptak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

English

Method 2: Batch Remove Hyperlinks from All Pictures in a


Document
There is the way to remove all hyperlinks from a document. First you press “Ctrl+ A” to select all contents. Then you
press “Ctrl+ Shift+ F9” to kill all hyperlinks. For your information, this way clears all hyperlinks both on pictures and
texts. Yet, our aim is to remove hyperlinks from pictures only. So we will have to utilize a macro to finish the job.

1. First of all, press “Alt+ F11” to trigger the VBA editor in Word.

2. Then in the editor, click on “Normal” project.


3. Next on the menu bar, click “Insert”.
4. And choose “Module” on the drop-down menu.

5. Now double click on the module to open its coding area on the right and paste the following macro there:

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

6. Last but not the least, click “Run” on menu bar to execute codes.
Method 3: Batch Remove Hyperlinks from Pictures in Multiple English

Documents
1. Before all, arrange all target documents in one folder.
2. Then repeat steps in method 2 to install and run the following macro:

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

3. In the “Browse” window open, pick the folder you set in step 1 and click “OK” to move on.

Be Cautious about Your Operation in Word


Word is not foolproof, so any wrong operation may easily trigger the collapse or worse, resulting document corruption.
While you can pay more attention to your operation skills and habits, you can also purchase a utility for doc recovery
beforehand.

You might also like