Micro Focus QTP (UFT) Forums
How to get text properties? - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to get text properties? (/Thread-How-to-get-text-properties)



How to get text properties? - manojc123 - 04-20-2010

Hi ankur,

I am recording an application where i want to read text properties like text color,font etc.
please help me

Regards
MAnoj


RE: How to get text properties? - Saket - 04-20-2010

You can use .Object.Currentstyle for any object to get the properties.
Try the code below-
Code:
Dim lnkobj

SystemUtil.Run "C:\Program Files\Internet Explorer\IExplore.exe","http://www.google.co.in/"

Set lnkobj =Browser("name:=Google").Page("title:=Google").Link("name:=Hindi").Object.currentStyle

print "Link BackGround Color ="& lnkobj.backgroundColor
print "Link font size ="& lnkobj.fontsize
print "Link font family ="& lnkobj.fontfamily
print "Link font color ="& lnkobj.color
print "Link text alignment ="& lnkobj.textalign

Set lnkobj=Nothing
Browser("name:=Google").Close



RE: How to get text properties? - manojc123 - 04-21-2010

Hi Saket,

Thanks for providing nice example.
But this will not work for me ,i want to read normal text color (Which is not link) and that text appear on window within table(desktop application)

Regards
Manoj