Helen,
Thanks for you reply. I added the TextSize variable initialization:
hwnd = UIObject.handle
dc = Win32Api.GetDC(hwnd)
ln = Len(UIObject.Text)
Set TextSize = Win32API.tagSIZE
ret = Win32Api.GetTextExtentPoint32(dc, UIObject.Text , ln, TextSize)
Call Win32Api.ReleaseDC(hwnd,dc)
And I put debugged the code chacking the TextSize variable before and after the call, in both cases it points to an object but it is empty, I never see the cx and cy members that should be there. I guess I am using the wrong structure name, I tried with TSize too getting the same results. I wonder if you know another way to create a size structure in vbscript
Luis