Question : Word doc. macro--download two web pages then compare

Do Macros (VBA) have the abllity to programmatically download two web pages and then compare them?

Basically, a VBA user form would collect two URLs, download them, then compare them. Is this possible with VBA in Word?

Answer : Word doc. macro--download two web pages then compare

Hi Bobo,
yes, you can open URLs in word like normal files.
How are you going to make comparison? Word has built-in feature for this, the snippet utilizes this feature.
Please provide more adequate URLs.

Alex
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Sub CompareURLs()
Dim doc1 As Document, doc2 As Document

Set doc1 = Documents.Open("http://google.com/")
Set doc2 = Documents.Open("http://yahoo.com/")

Application.CompareDocuments OriginalDocument:=doc1, RevisedDocument:=doc2, 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:="Author", IgnoreAllComparisonWarnings _
        :=False
    ActiveWindow.ShowSourceDocuments = wdShowSourceDocumentsBoth
End Sub
Random Solutions  
 
programming4us programming4us