Missing Method for GroupShape?

Hello,
I wonder why the class GroupShape doesn’t have the method “getStoryType” like implemented for simple Shapes.

Shouldn’t that be a feature of their common parent class “ShapeBase”?

So long,
Tom

Hi Tom,
Thanks for your request. GroupShape cannot be a Story. Story is a base class for elements that contain block-level nodes Paragraph and Table. Since, GroupShape can contain only other Shapes it is not Story and that is why it does not have StoryType property.
Best regards,

Hello Alexey,
thx for your fast response.

Ah I see! I used this method the wrong way. I thought I could use it to determine if the shape itself is placed within header, footer or body of a document.

So, by the way, is it possible to check in which story a shape is placed?

So long,
Tom

Hi Tom,
Thanks for your request. I think, you can simply try to get an ancestor of the shape of the specific type. If ancestor of this type is not null then shape is a child of this ancestor. For example:

///
/// Returns true if the node is onside HeaderFooter.
///
private bool IsHeaderFooterChild(Node node)
{
    return node.GetAncestor(NodeType.HeaderFooter) != null;
}

Hope this helps.
Best regards,

Jepp, that’s it!

I should have worked out that myself. :-S

Thx for your fast help.

So long,
Tom