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.



How to match two doc files using qtp requirment is:- each and every single word of a doc file sh..

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

Post New Answer

More QTP Interview Questions

Hi any body pls help me for QTP 11.0 software free demo version. i have to practice. Kindly send the link.or where i have to download.

0 Answers  


Explain about the Test Fusion Report of QTP?

1 Answers   Crea,


I Scheduled a QTP Script on remote desktop. Script is going to failure,when remote desktop connection fails.I have to open my remote desktop untile the scripts exection completes. If I disconnect my remote desktop connection, script is going to fail. Could you please any assist in this?

2 Answers  


What is test fusion report?

2 Answers   CIL,


Explain hybrid framework with advantages and disadvantages?

0 Answers  






Take a situation when you are working with QTP, suddenly system has crashed.so you again start the system. My questyion is how can QTP directly opened when the system desktop appears.

2 Answers  


What are the various automation frameworks available in qtp?

0 Answers  


How to do Laod testing for web based Application?

1 Answers  


Explain the concept of Output values in Quick Test Professional?

1 Answers   Crea,


What is the diff between doing parametarisation using Data Driven wizard or manually. when do we go for manual para...and when do we use Data driver wizard..can anybody answer it ..Thanks in advance

6 Answers   Siemens,


Is it possible to call from one action to another action in qtp?

0 Answers  


What are the properties you would use for identifying a browser and page when using descriptive programming?

0 Answers  


Categories