#1
|
|||
|
|||
Wildcards and track changes
Hello! I'm sorry in advance if this is not the right place to post question. I'm having this issue:
I have a client that sends me documents to update, but sometimes they don't use track changes, they instead paint and underline the new text and expect me to not miss a thing. I already have a way of finding that text with find and replace, but I would love to know if there is a way to change that text automatically using wildcards. My idea would be: 1- Have track changes activated 2- Find any instance of a word, number or symbol that is formatted in a certain way (e.g., blue color and double underline) 3- Replace that text with the exact same text, but have it show with track changes I have tried several ways with wildcards but I'm not that advanced yet and can't seem to hit the right string. I would love any advice!! |
#2
|
||||
|
||||
You don't need wildcards for this. For example:
Code:
Sub TrackChanges() Application.ScreenUpdating = False Dim bTrk As Boolean With ActiveDocument bTrk = .TrackRevisions .TrackRevisions = False With .Range With .Find .ClearFormatting .Format = False .Forward = False .Wrap = wdFindStop .Text = "" .Replacement.Text = "" .Font.Underline = True End With Do While .Find.Execute .Font.Underline = False .Cut ActiveDocument.TrackRevisions = True .Paste ActiveDocument.TrackRevisions = False .Collapse wdCollapseStart Loop End With With .Range With .Find .ClearFormatting .Forward = False .Wrap = wdFindStop .Font.StrikeThrough = True End With Do While .Find.Execute .Font.StrikeThrough = False ActiveDocument.TrackRevisions = True .Delete ActiveDocument.TrackRevisions = False .Collapse wdCollapseStart Loop End With .TrackRevisions = bTrk End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thank you!
Thank you so much for the help! Sadly, it didn't seem to work for me.
I think you used simple underline and mine is double. I tried tweaking it by myself but I don't know enough coding to make it work. These are the two formatting options that I would need changed: - Insertions are un double underline - Deletions are strikethrough I know I can leave the replace box empty for the deletions and that will do the trick, my only issue is with the insertions. Last edited by valentinator; 06-06-2022 at 11:16 AM. Reason: forgot attachments |
#4
|
|||
|
|||
Attaching formats for reference
|
#5
|
||||
|
||||
Simply change:
.Font.Underline = True to: .Font.Underline = wdUnderlineDouble
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
That's what I tried doing, but it tells me I can't paste selection into a table. Is there a way of working around this?
|
#7
|
||||
|
||||
Evidently, you have more than the simple addition/deletion of text going on. Without actually seeing the problem document, it can be difficult for anyone to diagnose the issue. Can you attach a document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#8
|
|||
|
|||
I was finally able to solve it. I wasn't removing the = True in the last line and that was causing the issue.
Thank you for your help! |
Tags |
formatting, track changes, wildcards |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using wildcards with SEARCH | 14spar15 | Excel | 7 | 10-14-2020 08:43 AM |
Creating PDF in track changes - simple track changes only | sophiah81 | Word | 8 | 07-19-2018 12:51 AM |
Wildcards | raghugada | Word VBA | 3 | 06-10-2017 01:52 AM |
Wildcards | Madcat | Word | 2 | 12-21-2014 08:27 PM |
Track Changes doesn't track Change Case changes | wardw | Word | 3 | 10-28-2012 05:31 PM |