The TP Help has a very good write up & example for the CaptureText method. Check out the applies to link to limit your results to the control that you need the data from. Doing a CaptureText on a form will give all the data, doing it on a Label will just give you the Label text.
To capute the whole text from the screen or dialog box, you need to attach that window first. Then you can use a capturetext propery which will store a value / text on the screen (active window) on a varible.
Refer following code:
str = Window("Application=IEXPLORE.EXE ClassName=IEFrame").CaptureText