Micro Focus QTP (UFT) Forums

Full Version: How to get text properties?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi ankur,

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

Regards
MAnoj
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
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