As an alternative, you can also use the GetROProperty for the object, which most likely is a text property, but you can use the ObjectSpy to confirm this. You can then grab the text in one step:
myval = Browser(''Browser'').Page(''Page'').WebEdit(''captext'').GetROProperty(''text'')
Also, another technique to strip out values from the output (such as only wanting the numeric values in your case) is to use the RegExp object in VBScript. Here's an example of using this:
'Strip a string on all non-numeric characters using the RegExp object in VBscript
myval=''Test ID 12245'' 'original string value from your output
with new RegExp 'initiate the RegExp object
.global = true 'define scope
.ignorecase = false 'ignore the case of the string
.pattern = ''[^0-9]'' 'This is our pattern. The ^ indicates any character NOT equal to 0 through 9
MyREval = .replace(myval,'''') 'Replace the non-numeric characters with empty space
end with 'end the With statement (optionally used for readability)
msgbox MyREval 'display the converted string. you can use the value in your script and not display it, of course. It's only used as an example