Results 1 to 2 of 2
  1. #1

    Can Compare a word and pdf document

    Can Compare a word and pdf document in TestComplete.....?
    Actually the apllication is generating two doc in given two format word and pdf , so help regarding.

    Thanks in advance

  2. #2

    Re: Can Compare a word and pdf document


    TestComplete does not have any built-in features that compare MS Word and PDF files. However, you can find a possible solution for comparing PDF files in the following thread of the official TestComplete newsgroup:


    As for comparing Microsoft Word documents, you can use Microsoft Word as an OLE server and compare the needed files by using the Compare method of the ActiveDocument object. The following sample script compares two Microsoft Word documents and, if they are different, creates a .doc file demonstrating the differences it finds:

    <font class="small">Code:</font><hr /><pre>
    ' VBScript
    Sub CompareTest
    Dim wrdApp
    Dim revTemp
    Dim file1, file2, differences

    Set wrdApp = CreateObject("Word.Application")
    wrdApp.Visible = True

    file1 = "c:\test1.doc"
    file2 = "c:\test2.doc"
    differences = "c:\differences.doc"

    wrdApp.Documents.Open file1
    wrdApp.ActiveDocument.Compare file2

    Set revTemp = wrdApp.Selection.NextRevision(True)

    If Not (revTemp Is Nothing) Then
    wrdApp.ActiveDocument.SaveAs differences
    Log.Error "Documents are not identical", "Please see the differences in " &amp; differences
    Log.Message "Documents are identical"
    End If
    wrdApp.Quit False
    End Sub
    <font class="small">Code:</font><hr /><pre>

    I hope this helps.
    Andrew - AQA Support



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:46 PM.

Copyright BetaSoft Inc.