We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Can't identify Frame in shape collection

Hi,

I'm trying to convert a template for Word 2003 which contains some images, and 2 frames with text inside. They seem to be in the shapes collection, but the shape.shapetype is "Image". I need to identify which shapes are the frames, then retrieve the height, width, top, left and paragraphs/runs inside.

(I can't change the template as this is a test to see whether we can automatically convert hundreds of templates that we have.)

Is there a problem with Aspose.Words or am I just being stupid!?!?

Any help would be greatly appreciated.

Thanks

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Could you please attach your document for testing? Also please provide me your code.

Best regards.

Hi

Thanks for looking at this. Here's a zip of the test template and the problem parts of my source code.

Steve

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for additional information. Frames were used in old versions of MS Word. In the newest versions they are replaced with TextBox shapes. Aspose.Words provides API to work with TextBox shapes. I think that you should change your document and use TextBox instead Frames.

Best regards.

As stated in the first post, we have hundreds of existing templates with frames and cannot change them manually.

Can they be changed automatically? Doesn't this still need the ability to identify whether an object is a frame or not?

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Text from frames is represented as regular paragraphs. Of course you can change paragraphs in document using Aspose.Words, but unfortunately you can’t know whether these paragraphs are placed inside frame or not. If you replace all frames in your document with TextBox shapes then you will be able easy change text inside TextBoxes using standard Aspose.Words API.

Best regards.

But how do I change all frames to textbox shapes automatically using code?!?!?

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Unfortunately you can’t do this automatically. You should do this manually.

Best regards.