Shape HasTxt property?

Hi there

I was wondering if there is an easy way to inspect Shape objects within Aspose Words to see if they contain text or paragraph objects, by using a boolean value for example such as “HasTxt”, rather than inspecting child nodes that the shape may have one by one. I checked the documentation but there doesn’t seem to be one, maybe I missed it?

Thanks

Eric

Hi Eric,
Thanks for your request. No, there is no such property. I think, it is not so difficult to implement it yourself. For instance:

///
/// Returns true if shape contains any text.
///
private static bool HasText(Shape shape)
{
    return !string.IsNullOrEmpty(shape.ToTxt());
}

Hope this helps.
Best regards,