Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-08-2012, 12:15 PM
cure4glass cure4glass is offline Accept all changes then resave Windows Vista Accept all changes then resave Office 2007
Novice
Accept all changes then resave
 
Join Date: Feb 2012
Posts: 7
cure4glass is on a distinguished road
Default Accept all changes then resave

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!
Reply With Quote
  #2  
Old 03-08-2012, 10:04 PM
macropod's Avatar
macropod macropod is offline Accept all changes then resave Windows 7 64bit Accept all changes then resave Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

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
Note that this uses the same GetFolder function as in the other thread. If you put both subs in the same folder, you only need one copy of the GetFolder function.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accept all changes then resave 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:21 AM.


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