I use InDesign CS2 and VBScript
As I loop down the PageItems in a Page, I need to determine the Object Type (TextFrame, Group, GraphicLine ...) of each PageItem and process accordingly.
Is there a VBS method/function that wiil return the Object Type of an object either as a string or a value. Or do I have to check for the existance/non-existance of a particular property associated with a particular object type in order to do this?
In JS you can get the obj.constructor
I managed to do what I wanted without needing to know the object type after all.
FYO I wanted to loop through all PageItems on a Page and get their size and location to see if any were overlapping. I found a property common to all PageItems types that provided that information - GeometricBounds.
For the record: TypeName is what you need.
For instance, when the cursor is planted in the text TypeName(Ind.Selection(1)) returns "InsertionPoint." When a text frame is selected it returns "TextFrame".