Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-26-2016, 02:55 PM
macropod's Avatar
macropod macropod is offline Removing Hyperlinks in Multiple Documents at Once Windows 7 64bit Removing Hyperlinks in Multiple Documents at Once Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The following macro will unlink all fields and delete metadata in all documents in a selected folder:


Code:
Sub UpdateDocuments()
Application.ScreenUpdating = False
Dim strFolder As String, strFile As String, strDocNm As String, wdDoc As Document
strDocNm = ActiveDocument.FullName
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.doc")
While strFile <> ""
  If strFolder & "\" & strFile <> strDocNm Then
    Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False)
    With wdDoc
      .Fields.Unlink
      .RemoveDocumentInformation (wdRDIAll)
      .Close SaveChanges:=True
    End With
  End If
  strFile = Dir()
Wend
Set wdDoc = Nothing
Application.ScreenUpdating = True
End Sub

Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 12-26-2016, 08:09 PM
Jude24Joy Jude24Joy is offline Removing Hyperlinks in Multiple Documents at Once Windows 8 Removing Hyperlinks in Multiple Documents at Once Office 2013
Novice
Removing Hyperlinks in Multiple Documents at Once
 
Join Date: Dec 2016
Posts: 15
Jude24Joy is on a distinguished road
Default

Wow. Thank you so much. I really appreciate it! I'll give it a try in a bit.

Reply With Quote
  #3  
Old 12-26-2016, 10:43 PM
Jude24Joy Jude24Joy is offline Removing Hyperlinks in Multiple Documents at Once Windows 8 Removing Hyperlinks in Multiple Documents at Once Office 2013
Novice
Removing Hyperlinks in Multiple Documents at Once
 
Join Date: Dec 2016
Posts: 15
Jude24Joy is on a distinguished road
Default

This worked great! I'm much obliged! Thank you!

Is there a way to give credit/kudos/thanks to the people who help me on this forum?

Thanks!

ETA: Found the reputation scales.
Reply With Quote
  #4  
Old 12-26-2016, 11:58 PM
macropod's Avatar
macropod macropod is offline Removing Hyperlinks in Multiple Documents at Once Windows 7 64bit Removing Hyperlinks in Multiple Documents at Once Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Jude24Joy View Post
Is there a way to give credit/kudos/thanks to the people
There are two ways:
a) letting others know how much you appreciate the help given; and
b) using the reputation tools, which I see you've found (thanks).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 06-05-2017, 05:51 AM
WH7262 WH7262 is offline Removing Hyperlinks in Multiple Documents at Once Windows Vista Removing Hyperlinks in Multiple Documents at Once Office 2007
Novice
 
Join Date: Aug 2014
Location: Texas
Posts: 7
WH7262 is on a distinguished road
Default Sub UpdateDocuments Macro

This macro works great on .doc files, but I have .html files to work on. I tried changing the following line with .doc to .html
It worked but created a new folder for each file with the following files in that folder:
colorschememapping.xml
filelist.xml
themedata.xml
and then save each file as a .doc in the folder where the .hyml files were located

Also found that a closed parenthesis was needed at the end of (wdRDIALL
Can anyone be of some help here?

I am running Word 2010 in Bootcamp on a MAC for now, having issues with the MAC keyboard, so switched over to Bootcamp.

Thanks a lot for the macro and Kudos to Paul Edstein for creating the macro.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Hyperlinks in Multiple Documents at Once Hyperlinks: Removing Underline reRanger Word 2 08-04-2016 02:29 AM
Removing Hyperlinks in Multiple Documents at Once Protected Document: Multiple Hyperlinks Andrew H Word VBA 7 11-26-2012 01:08 PM
Removing Hyperlinks in Multiple Documents at Once remove multiple hyperlinks jwallace113 Word 5 03-31-2012 05:48 AM
Insert Multiple hyperlinks to word repeated in doc - easily synses Word 8 02-24-2012 05:17 AM
Hyperlinks in locked documents? Chris_S Word 0 01-26-2010 11:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft