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


Please Help Members By Posting Answers For Below Questions

give me an example where u used good judgement and logic in solving a problem

3438


Explain quicktest professional (qtp) testing process?

634


I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.

1679


How will you test a keyboard?

694


How to analyzing test results using quicktest professional (qtp)?

676






What are the different recording modes and how do they work?

703


What are the different attributes used with regular expression?

640


what is run-time data?

1798


How many types of parameters are there?

626


when u script reveiwing in which area u more concentrates?

1496


How to remove the associated function library?

615


How to use parameterization in qtp?

716


Explain how Selenium is different from UFT?

783


how u will evaluate the tool for test automation?

1459


i have to login into gmail loginpage i have to pass testcase into userid and password by using functions. the test case of user id is it should take only lowerletters alphabetin between 4 to 6 length.it should not take spectial letters.it should not take numbers.testcase for password is it should take numbers and it should not take alphabets note the following things must happen 1 when i give correct password and userid that password and userid should be seen in QTP result and notepad,xl sheet 2 when i gave in valid password the system willgive message please give valid password that particular messaage should be seen in QTP result,norepa and xl sheet

1862