The Parent object of a component is the sheet block, you can get the name and sheet number from that object, like this:
sSheetNum = compObj.Parent.GetName(FULL_PATH_FROM_BLOCK) + "." & compObj.Parent.SheetNum
For hierarchical sheet numbering, you may need to look for the border symbol first, and get the instance value of the sheet property annotated by the Cross Reference tool.
thanks for your help - the GetName(FULL_PATH_FROM_BLOCK) is not listed in the documentation for "Block Object".
Nevertheless the important stuff is to get the unique sheet number property attached to the border symbol.
I noticed that I can get it from the compObj.Parent.FindProperty(), but actually the parent is a Block Object and not the Border's Component Object - I'm still confused.
Can you please have a look at the attached report_globals.vbs and explain why it does work?
report_globals.vbs.zip 935 bytes
Good question! It seems that Block.FindAttribute will look at the border symbol instance and return the border property - I did not know that either...