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 Posted / 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 |
Post New Answer View All Answers
1. What is the difference between Keyword and function in the keyword driven framework? 2. How do you associate Keywords to the script ?
Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.
How to customize qtp?
What are the various types of Actions in UFT?
what function you write to do database testing with the help of qtp?
Can any body please tell me the steps of keyword driven framework of QTP.
What is difference between Recording time object identification and Run time (Execution) time.
Explain the difference between check point and output value?
When ‘option explicit’ keyword is used in qtp?
What is throw Object?
In Test Directory, What are the contents in test case designing? if you prepare in excel sheet how u use thrw Test Directory?
Give me At Least 5 Differences between DOCUMENTATION OBJECT MODEL(DOM)and COMPONENT OBJECT MODEL(COM)? Interviewer said me to WRITE the difference only in points not as you WRITE a paragraph ???? only in points
You will receive the mail in your outlook from client at night time to go ahead for the execution. Based on the mail you need to trigger the batch run. What is the QTP Code for this?
Explain different type of event trigger option.
What is Unicode Compatibility?