We want to develop a script that would read data from an old form and populate it into a new form.
The boxes shown in the form are different fields and would contain diff. values. We basically wanna pick up those field-values and save them in a new form.
We haven't started off yet because QTP is unable to recognise the fields and so we are stuck at the very first step.
Try this script its for read the data from word.....................
Code:
set a=CreateObject("Word.Application")
set b=a.Documents.Open("c:\read2.doc")
p_count=b.Paragraphs.Count
msgbox p_count
for c=1 to p_count
str_range=b.Paragraphs(c).Range.Start
end_range=b.Paragraphs(c).Range.End
Set s_range=b.Range(str_range,end_range)
x_str=s_range.Text
if len(x_str)=1 then
msgbox "false"
else
msgbox x_str
end if
next
a.Quit
set a=nothing
set b=nothing