PC Review


Reply
Thread Tools Rate Thread

Compare word document in excel

 
 
KK
Guest
Posts: n/a
 
      12th Aug 2009
Private Sub Start_Click()


Dim Word As Object
Set Word = CreateObject("Word.application")

Dim name, name2 As String

Application.DisplayAlerts = False
Word.Documents.Open (OfFile), ReadOnly:=True
Word.Visible = True
name = Word.ActiveDocument.name

Word.Documents.Open (rfFile), ReadOnly:=True
Word.Visible = True
name2 = Word.ActiveDocument.name

Word.Activate
Application.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:="KkK", IgnoreAllComparisonWarnings:=False

ActiveWindow.ShowSourceDocuments = wdShowSourceDocumentsBoth


End Sub

How can i compare two word document in excel , then display result in
Microsoft word???
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      12th Aug 2009
Isn't that what your macro is doing? what else do you need?

"KK" wrote:

> Private Sub Start_Click()
>
>
> Dim Word As Object
> Set Word = CreateObject("Word.application")
>
> Dim name, name2 As String
>
> Application.DisplayAlerts = False
> Word.Documents.Open (OfFile), ReadOnly:=True
> Word.Visible = True
> name = Word.ActiveDocument.name
>
> Word.Documents.Open (rfFile), ReadOnly:=True
> Word.Visible = True
> name2 = Word.ActiveDocument.name
>
> Word.Activate
> Application.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:="KkK", IgnoreAllComparisonWarnings:=False
>
> ActiveWindow.ShowSourceDocuments = wdShowSourceDocumentsBoth
>
>
> End Sub
>
> How can i compare two word document in excel , then display result in
> Microsoft word???

 
Reply With Quote
 
ryguy7272
Guest
Posts: n/a
 
      12th Aug 2009
Consider this:
http://www.softinterface.com/MD%5CDo...n-Software.htm

It's free and it works great!

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Joel" wrote:

> Isn't that what your macro is doing? what else do you need?
>
> "KK" wrote:
>
> > Private Sub Start_Click()
> >
> >
> > Dim Word As Object
> > Set Word = CreateObject("Word.application")
> >
> > Dim name, name2 As String
> >
> > Application.DisplayAlerts = False
> > Word.Documents.Open (OfFile), ReadOnly:=True
> > Word.Visible = True
> > name = Word.ActiveDocument.name
> >
> > Word.Documents.Open (rfFile), ReadOnly:=True
> > Word.Visible = True
> > name2 = Word.ActiveDocument.name
> >
> > Word.Activate
> > Application.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:="KkK", IgnoreAllComparisonWarnings:=False
> >
> > ActiveWindow.ShowSourceDocuments = wdShowSourceDocumentsBoth
> >
> >
> > End Sub
> >
> > How can i compare two word document in excel , then display result in
> > Microsoft word???

 
Reply With Quote
 
KK
Guest
Posts: n/a
 
      13th Aug 2009
The application.CompareDocuments wasn't not work .....why ?

"Joel" wrote:

> Isn't that what your macro is doing? what else do you need?
>
> "KK" wrote:
>
> > Private Sub Start_Click()
> >
> >
> > Dim Word As Object
> > Set Word = CreateObject("Word.application")
> >
> > Dim name, name2 As String
> >
> > Application.DisplayAlerts = False
> > Word.Documents.Open (OfFile), ReadOnly:=True
> > Word.Visible = True
> > name = Word.ActiveDocument.name
> >
> > Word.Documents.Open (rfFile), ReadOnly:=True
> > Word.Visible = True
> > name2 = Word.ActiveDocument.name
> >
> > Word.Activate
> > Application.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:="KkK", IgnoreAllComparisonWarnings:=False
> >
> > ActiveWindow.ShowSourceDocuments = wdShowSourceDocumentsBoth
> >
> >
> > End Sub
> >
> > How can i compare two word document in excel , then display result in
> > Microsoft word???

 
Reply With Quote
 
KK
Guest
Posts: n/a
 
      13th Aug 2009
Private Sub Start_Click()


Dim Word As Object
Set Word = CreateObject("Word.application")

Dim name, name2 As String

Application.DisplayAlerts = False
Word.Documents.Open (OfFile), ReadOnly:=True
Word.Visible = True
name = Word.ActiveDocument.name

Word.Documents.Open (rfFile), ReadOnly:=True
Word.Visible = True
name2 = Word.ActiveDocument.name

Word.Activate
Word.Documents(rfFile).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.Visible = True

Word.Documents(OfFile).Close
Word.Documents(rfFile).Close
Application.DisplayAlerts = True
Word.Quit
Set Word = Nothing



End Sub


Now i can compare the documents , but only once ,then show the run time
error "462",The remote server machine does not exist or is unavailable.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Word 2007: How to Compare current document? Neitsdelf Microsoft Word Document Management 0 27th Apr 2011 07:11 PM
Excel VBA Programming: Word Document Compare? Keri B Microsoft Excel Misc 0 19th Jan 2010 05:12 PM
Word Compare and Merge Document Function =?Utf-8?B?RXJpY00=?= Microsoft Word Document Management 2 28th Mar 2005 11:53 PM
Word cannot compare a master document =?Utf-8?B?bmV3dXNlcg==?= Microsoft Word New Users 1 17th Nov 2004 02:13 PM
How to compare documents in Word 97 when one document already has. =?Utf-8?B?QXVyb3Jh?= Microsoft Word Document Management 1 11th Nov 2004 11:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:43 PM.