Stripping mc:AlternateContent nodes in Office 2010 onwards

Hi,
Is there a way in which we can strip out the mc:AlternateContent nodes and revert to what is present in the fallback option of this node for shapes and group-shapes inserted in Office 2013? Also, we realize that we may lose out some of the features of the later version of Word, but would the look and feel of the content in the document be identical if we could achieve the former? Thank you!

Hi,

Thanks for your inquiry. We are in coordination with our product team to get answer pertaining to your queries. Soon you will be updated with the required information.

Best regards,

Hi,

Our product team needs to understand real situation what exactly you’re trying to implement. Please provide complete details of your use-case. Currently we are treating fallback according to the OOXML specifications, as per which it simply means to show content to older versions of MS Word that do not support DrawingML.

Best regards,

Hi Awais,
We’re seeing compatibility issues especially with shapes in Office 2013 documents when merged with Office 2007 documents. We’re trying to revert the shapes in the 2013 documents to whatever is present in the fallback option of the mc:AlternateContent nodes and utilize these and strip out the remaining content in the mc nodes in the document xml. This is a high-level picture I’m presenting here - please let me know if you seek any more details. Thanks!

Hi,

Thanks for your inquiry. We are in coordination with our product team to get answer pertaining to your queries. Soon you will be updated with the required information.

Best regards,

Hi,

Thanks for being patient. Since this is a very unusual request, our product team don’t think that they should modify public Aspose.Words API to accommodate for it. Instead they would like to advise you please use the following simple workaround:

Saving a document to any of the formats that do not support DrawingML will result in removal of AlternateContent, the Choice element will be converted into VML object (Vector ML) which is what Fallback part holds anyway.

So to do this you can save into DOC, RTF or WML and load the document again :

Document doc = GetDocument();
doc.Save(@"temp.doc");
doc = new Document(@"temp.doc");
doc.Save(@"NoAlternateContent.docx");

Hope, this helps.

Best regards,

Hi Awais,
I wanted to make you aware of the context in which we’re needing this feature. When we’re setting certain image attributes, such as alt text for shapes in an Office 2013 document, we’re seeing that Aspose is setting this attribute only for the drawingML component of the mc:AlternateContent, and it isn’t setting it in the VML associated in the fallback! Now, when we merge this document with a document generated in Office 2007, say, then what happens is that to support backward compatibility, Aspose somehow triggers the usage of the fallback component of the Office 2013 document, and we therefore lose out the information we set in the image attributes. We’re trying to seek a way to retain that information essentially.
The problem with the suggestion made in the reply is that we may lose out a lot of the functionality of components inserted through later versions of Office when the document is made compatible by saving it as a .doc file. We want to avoid that, and see if there can be a selective way of stripping certain content, since some attributes are localized only to some nodes of the alternate content.
We have raised two other forum threads with the same issues, and I’m pasting those for your reference.
Issue with set image alt text being lost

Hope this helps. Thanks!

Hi,

Thanks for the details and sharing the other two threads. We are checking this scenario and will get back to you soon.

Best regards,

Hi,

As mentioned in your other thread, please use CompatibilityOptions.OptimizeFor method to optimize the document contents as well as default Aspose.Words behavior to a particular versions of MS Word. Using this method allows Aspose.Wods to mimic MS Word version-specific application behavior.

Best regards,