VBA-Word Extend Revision to the whole word -


i'm analyzing revised documents. have change tracking enabled, , contain many revisions.

these documents required have revision on whole word, not part of it. revisions used qa, cannot flag revised words not revised. must make words have revised letters words revised, cannot touch other words.

i want automate this. figured this:

dim wrdrange range each wrd in thisdocument.words     set wrdrange = wrd     if wrdrange.revisions.count <> 0         wrdrange.text = wrdrange.text     end if next wrd 

it's working half way, every time encounters revised word (partially or fully), make avery other word revised (there revision count of 1 on them).

so question how can fix this.

also, i'm not @ sure best way perform task. feel isn't. if can offer direction, i'll gladly follow (i not approach - specially iterating through every word).

i found solution. 1 word flagged revision flagging next 1 revision because include trailing whiteaspace. shortened range in case, , works:

dim wrdrange range each wrd in thisdocument.words     set wrdrange = wrd     if wrdrange.revisions.count <> 0         if mid(wrdrange.text, len(wrdrange.text)) = " "             wrdrange.end = wrdrange.end - 1         end if          wrdrange.text = wrdrange.text     end if next wrd 

i'm not sure yet if reliable. have feeling situations might crash resizing ranges did. i'll know once run on production. fix/comment here.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -