Fellow Scripters,
I agree that the documentation should cover text variables better--and I created it. There just wasn't time to get them in, and it's high on my list of things to fix for CS4.
Ken, I don't think you need another browser--the VB6 version is at least as good as the JavaScript versions mentioned above. The only trick is to understand that TextVariable.VariableType tells you which "preferences" object to look at for the settings for the variable.
For a simple text (custom) variable, you'd see that the VariableType is idVariableType.idCustomTextType. That tells you that the object you want to look at is the CustomTextVariablePreference object. Looking at that object, you can see that it has only a Content and a Parent property.
This, by the way, is why the type of the TextVariable.VariableOptions property is a Variant--it can be any of the text variable preferences objects. When you think of the question in terms of the user interface, this seems reasonable--the different preferences objects correspond to the menu choices in the Text Variables dialog box. The menu choice you make changes the controls that appear in the dialog box. The controls correspond to the options in the preferences object.
Which brings me to a point: the more you know about the way that InDesign works, the easier it is to understand the object model. That said, InDesign is a big program, with a very large object model!
Sorry I didn't get to text variables in the documentation, and I'll do better next time. Until then, ask questions here! It's an incredible resource.
Thanks,
Ole