![]() |
|
#1
|
|||
|
|||
![]()
Thanks to Macropod I was able to go into a selected folder and remove password protection from my documents contained within by using the code provided by him.I'd like to do the same sort of thing but rather than remove the password protection(There is none now), I'd like to have the code go in each document of a selected folder and under the Review tab, accept all changes then resave.If this is a viable option, it would save a lot of time.
Thanks in advance! |
#2
|
||||
|
||||
![]()
Hi cure4glass,
Only a slight modification of the previous code is required. I've trimmed it down to the basics, however: Code:
Sub AcceptDocumentRevisions() Application.ScreenUpdating = False Dim strFolder As String, strFile As String, wdDoc As Document strFolder = GetFolder If strFolder = "" Then Exit Sub strFile = Dir(strFolder & "\*.doc", vbNormal) While strFile <> "" Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False) wdDoc.AcceptAllRevisions wdDoc.Close SaveChanges:=True 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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Newbe1 | Word | 3 | 12-23-2010 03:05 PM |
How to Set Password to Accept Changes | kurobenko | Word | 1 | 05-12-2010 02:54 AM |
MS Word 2007 - Product Key Not Accept | Ramesh | Office | 0 | 02-18-2010 02:14 PM |
Unable to Accept / Decline Appointments Sent to Me - HELP! | FrUtopia27 | Outlook | 0 | 04-16-2007 03:24 PM |