Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2016, 06:59 AM
saks12 saks12 is offline Macro to check percentage revisions in a file with tracked changes Windows 10 Macro to check percentage revisions in a file with tracked changes Office 2013
Novice
Macro to check percentage revisions in a file with tracked changes
 
Join Date: Jan 2016
Posts: 4
saks12 is on a distinguished road
Default Macro to check percentage revisions in a file with tracked changes

Hi everyone,
I hope I'm in the right place for this. I'm on the lookout for a macro that'll calculate the percentage of revisions on a word file with tracked changes.

Does a macro like this already exist? If not, any tips on how I can go about designing something like this would be great!



Thanks,
Reply With Quote
  #2  
Old 01-04-2016, 05:15 PM
macropod's Avatar
macropod macropod is offline Macro to check percentage revisions in a file with tracked changes Windows 7 64bit Macro to check percentage revisions in a file with tracked changes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Would would the percentage relate to - number of words or the number characters? As a percentage of whatever it relates to as the document exists before making the changes, or after making them? And are the counted revisions for content inserted, moved, deleted, replaced or reformatted?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 01-13-2016, 03:46 AM
saks12 saks12 is offline Macro to check percentage revisions in a file with tracked changes Windows 10 Macro to check percentage revisions in a file with tracked changes Office 2013
Novice
Macro to check percentage revisions in a file with tracked changes
 
Join Date: Jan 2016
Posts: 4
saks12 is on a distinguished road
Default

Sorry for the late response! It would be a percentage of the number of characters changed (either inserted or deleted) to the original character count. I think it cannot be both because the percentage needs to be a 100 and no more (so if a sentence had 100 characters, and lets' say the edit included deleting the entire sentence (100 deletions) and then adding (about 50) characters, the ratio should not exceed 100%. So, in the end, I'm not sure but if I visually saw a sentence full of deletions/insertions I would say it was 100% revisions, but I am not able to put a formula to it. Any suggestions?
Reply With Quote
  #4  
Old 01-13-2016, 04:38 AM
macropod's Avatar
macropod macropod is offline Macro to check percentage revisions in a file with tracked changes Windows 7 64bit Macro to check percentage revisions in a file with tracked changes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

But, on your reckoning, if you start out with 100 characters and add another 150, or replace the initial 100 with 150 different characters, the % change would necessarily be 150 in either case.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 01-13-2016, 04:48 AM
saks12 saks12 is offline Macro to check percentage revisions in a file with tracked changes Windows 10 Macro to check percentage revisions in a file with tracked changes Office 2013
Novice
Macro to check percentage revisions in a file with tracked changes
 
Join Date: Jan 2016
Posts: 4
saks12 is on a distinguished road
Default

True, I can work with that as well. How can I go about desigining something like this?
Reply With Quote
  #6  
Old 01-13-2016, 10:24 PM
macropod's Avatar
macropod macropod is offline Macro to check percentage revisions in a file with tracked changes Windows 7 64bit Macro to check percentage revisions in a file with tracked changes Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

Try something along the lines of:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim bRevShow As Boolean, RevView As Long
Dim r As Long, i As Long, d As Long, o As Long
With ActiveDocument
  With ActiveWindow.View
    bRevShow = .ShowRevisionsAndComments
    RevView = .RevisionsView
    .ShowRevisionsAndComments = False
    .RevisionsView = wdRevisionsViewOriginal
  End With
  o = .ComputeStatistics(wdStatisticCharactersWithSpaces)
  For r = 1 To .Revisions.Count
    With .Revisions(r)
      If .Type = wdRevisionInsert Then i = i + .Range.ComputeStatistics(wdStatisticCharactersWithSpaces)
      If .Type = wdRevisionDelete Then d = d + .Range.ComputeStatistics(wdStatisticCharactersWithSpaces)
    End With
  Next
  With ActiveWindow.View
    .ShowRevisionsAndComments = bRevShow
    .RevisionsView = RevView
  End With
  MsgBox "The active docuument originally contained " & o & " characters." & vbCr & _
  "It has had " & i & " characters added and " & d & " characters deleted." & vbCr & _
  "Additions and deletions account for " & Format(i * 100 / o, "0") & "% and " & Format(d * 100 / o, "0") & "%," & vbCr & _
  "respectively, of the original length."
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to check percentage revisions in a file with tracked changes Someone please check my macro BIMwit Excel Programming 6 06-13-2015 12:04 PM
Macro to check percentage revisions in a file with tracked changes How to open the Revisions pane? billy8b8 PowerPoint 4 12-17-2014 04:22 PM
Code Error - Hiding comments and revisions silvrwoman Word VBA 6 03-24-2012 10:15 PM
Macro to check percentage revisions in a file with tracked changes Word Macro That Checks a Check Box Form Field When File Print is Executed DKerne Word VBA 4 06-09-2011 11:54 AM
Macro to check percentage revisions in a file with tracked changes Check Box Macro Johnny thunder Word VBA 12 04-07-2011 04:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:40 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