How to match two doc files using qtp
requirment is:- each and every single word of a doc file
should be matched with the another doc file. can someone
send me the code.
Answer / kavitapriya cr
Use the script below:
Dim fso,FileName1,FileName2,File1,File2
Set wrdApp=CreateObject("Word.Application")
Set FileName1=wrdApp.Documents.Open("Path\FileName1.doc")
Set FileName2=wrdApp.Documents.Open("Path\FileName2.doc")
Set File1=fso.GetFile(FileName1).OpenAsTextStream(1,0)
Set File2=fso.GetFile(FileName2).OpenAsTextStream(1,0)
CompareFile=True
Do While File1.AtEndOsStream=False
String1=File1.Read(1000)
String2=File2.Read(1000)
If StrComp(String1,String2<>0) Then
CompareFile=False
Exit Do
End If
Loop
If CompareFile=True Then
MsgBox "Files are matching"
else
MsgBox "Files are not matching"
End If
File1.Close
File2.Close
FileName1.Close
FileName2.Close
| Is This Answer Correct ? | 0 Yes | 0 No |
Do we have to Enable Smart Identification while running Or will it automatically be enabled ?
how your doing reporting in your script?
How u perform Batch Program in QTP?
How many types of Recordings are there in QTP and what are they?
7 Answers Dangote, First Indian Corporation,
How to handle Run-time errors?
how you have used object libraries? plzzzzz do answer
What is Environment Variable and when we apply this in QTP?
how i will connect oracle or microsoft acess database through manually written Script
I want two test two agents login for the flight website. Here is the scenario: I want to go through 1-3 rows for one user login and other user login I want to go though 3-5 rows. How would you set this up in qtp. Thank You
How can i open a file in Textpad and replace a string with another using QTP
How to create runtime property for an object?
write a script for get the following result: username password frm the string1="A=username" string2="B=password"