Run time error 462
HI Joel ,
I had try your way to fix problem , but it doesn't work .Anyway , thanks
for your help .
KK
"Joel" wrote:
see if this fixes the problem I have 2003 whichhas a COMPARE method not a
COMPAREDOCUMENTS method.
from
Word.CompareDocuments
to
Word.activedocument.CompareDocuments
"KK" wrote:
Private Sub Start_Click()
ThisWorkbook.Activate
Dim Word As New Word.Application
Set Word = CreateObject("Word.Application")
Word.Visible = True
If (Word.Visible < True) Then
Word.Visible = True
Else
End If
Dim name, name2 As String
Application.ScreenUpdating = False ' Turn off the screen updating
Application.DisplayAlerts = False
Word.Documents.Open (OfFile), ReadOnly:=True
name = Word.ActiveDocument.name
Word.Documents.Open (rfFile), ReadOnly:=True
name2 = Word.ActiveDocument.name
Word.Activate
Word.Documents(name).Select
Word.CompareDocuments OriginalDocument:=Documents(name), _
RevisedDocument:=Documents(name2), _
Destination:=wdCompareDestinationNew, _
Granularity:=wdGranularityWordLevel, CompareFormatting:=True, _
CompareCaseChanges:=True, CompareWhitespace:=True, CompareTables:=True, _
CompareHeaders:=True, CompareFootnotes:=True, CompareTextboxes:=True, _
CompareFields:=True, CompareComments:=True, CompareMoves:=True, _
RevisedAuthor:="KK", IgnoreAllComparisonWarnings:=False
Word.ActiveWindow.ShowSourceDocuments = wdShowSourceDocumentsBoth
Word.Documents(OfFile).Close
Word.Documents(rfFile).Close
Set Word = Nothing
Application.DisplayAlerts = True
Application.ScreenUpdating = True ' Turn off the screen updating
End Sub
Debug stop at Word.CompareDocuments ,Display the remote server machine does
not exist or is unavailable.
|