![]() |
|
#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] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
accept grammar errors
|
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 |