Link to home
Start Free TrialLog in
Avatar of WonHop
WonHopFlag for United States of America

asked on

Remove Underline From TrackRevisions in MS Word Table

Hello All.  Is there a way to remove the Underline from TrackRevisions in MS Word.  This code I am using is below.
I have the data in a MS Access Table. The results come from comparing the data in 2 other tables.
 I am adding the results to a table in MS Word. When is is added to the MS Word Table using "TrackRevisions = True", it has an underscore.  
The underscore is fine if it is an "ADD" or "New Term".  If it is a "DELETE" or Term that has been removed, I need to remove the underscore.
I need to keep TrackRevisions on for all ADD and DELETE Terms.  It is turned off for Terms that have a MATCH'

I have attached a photo to show the difference  between VB and VBA.

    If strtxtStatusAAW = "Delete" Then
        objDoc.TrackRevisions = True
        strTrackRevisions = True
        tblAppA.Rows(intrsttblAppendixAWorkingRowCounter).Select
        tblAppA.Cell(intrsttblAppendixAWorkingRowCounter, 1).Range.Text = strttxtTermAAW
        tblAppA.Cell(intrsttblAppendixAWorkingRowCounter, 2).Range.Text = strttxtDefinitionAAW
        tblAppA.Rows(intrsttblAppendixAWorkingRowCounter).Range.Font.Strikethrough = True
        blAppA.Rows(intrsttblAppendixAWorkingRowCounter).Range.Font.Underline = wdUnderlineNone
    End If

Thanks
WonHop
TrackChangesUnderline.JPG
Avatar of WonHop
WonHop
Flag of United States of America image

ASKER

Hello All.  I got it to work.  The key was to set TrackRevisions = True.  Add the data. Add the Strikethrough .
Then set TrackRevisions = False and Add the data again.  It keeps the Strikethrough , but it get rid of the Underline.

    If strtxtStatusAAW = "Delete" Then
        objDoc.TrackRevisions = True
        tblAppA.Rows(intrsttblAppendixAWorkingRowCounter).Select
        tblAppA.Cell(intrsttblAppendixAWorkingRowCounter, 1).Range.Text = strttxtTermAAW
        tblAppA.Cell(intrsttblAppendixAWorkingRowCounter, 2).Range.Text = strttxtDefinitionAAW
        tblAppA.Rows(intrsttblAppendixAWorkingRowCounter).Range.Font.Strikethrough = True
        objDoc.TrackRevisions = False
        tblAppA.Cell(intrsttblAppendixAWorkingRowCounter, 1).Range.Text = strttxtTermAAW
        tblAppA.Cell(intrsttblAppendixAWorkingRowCounter, 2).Range.Text = strttxtDefinitionAAW
        tblAppA.Rows(intrsttblAppendixAWorkingRowCounter).Range.Font.Color = 204
   End If
ASKER CERTIFIED SOLUTION
Avatar of WonHop
WonHop
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial