Micro Focus QTP (UFT) Forums
need to read data from microsoft word based forms - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: need to read data from microsoft word based forms (/Thread-need-to-read-data-from-microsoft-word-based-forms)



need to read data from microsoft word based forms - pvinay - 07-19-2009

the application that we are trying to automate reads data from microsoft based word forms.

i have attached a sample form here. I found that QTP is not able to recognise the different fields on these forms and hence is unable to capture data.

can someone suggest a way so that QTP can recognise the fields that are given in the word document?


RE: need to read data from microsoft word based forms - KVK - 07-20-2009

Hi

Do you want to read or retrieve each word in ms word document?

Please paste the code that you tried

- Mr.K


RE: need to read data from microsoft word based forms - pvinay - 07-20-2009

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.


RE: need to read data from microsoft word based forms - balakrish - 07-21-2009

Hi vinay,

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



RE: need to read data from microsoft word based forms - shriqtp - 08-04-2009

Hi pvinay,

Did you got exact code to get Row & Column data from MS-Word file/Form, if so then please send the code. I have a need of it.

Thanks in advance. (i will be really grateful to you if you can send the code for it)
Shrinivas