View Single Post
 
Old 11-07-2014, 01:29 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit 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

That alert has nothing to do with the comparison, really. It's telling you the document has a corrupt table. You should fix that. Instead of using 'Open and Repair' as the dialogue suggests, corrupt tables can often be 'repaired' by converting the tables to text and back again or by saving the document in RTF format, closing the document then re-opening it and re-saving in the doc(x) format – or see the macro below.
Code:
Sub TableRepair()
'Macro to repair damaged tables by saving each table in an RTF-format file, then
' reinserting the table from the RTF-format file into the source document.
Application.ScreenUpdating = False
Dim Rng As Range, i As Long, RTFDoc As Document, strPath As String
With ActiveDocument
  strPath = .Path & "\"
  For i = .Tables.Count To 1 Step -1
    Set Rng = .Tables(i).Range
    Set RTFDoc = Documents.Add(Visible:=False)
    With RTFDoc
      .Range.FormattedText = Rng.FormattedText
      .SaveAs2 FileName:="strPath & RTFDoc.RTF", Fileformat:=wdFormatRTF, AddToRecentFiles:=False
      .Close
    End With
    Set RTFDoc = Documents.Open(FileName:="strPath & RTFDoc.RTF", AddToRecentFiles:=False, Visible:=False)
    Rng.Tables(1).Delete
    With RTFDoc
      Rng.FormattedText = .Tables(1).Range.FormattedText
      .Close
    End With
    Kill "strPath & RTFDoc.RTF"
  Next
End With
Set Rng = Nothing: Set RTFDoc = Nothing
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote