Feasibility of copying the tempalte definitions to document.
-
Monday, March 11, 2013 10:43 AM
Hi,
How feasible it is to copy the template definitions to a to an existing docx file and what are the things to be aware of?
Related posts i have already entered:
http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/199ff247-529e-4fe3-a8aa-bf292aa11010
http://social.msdn.microsoft.com/Forums/en-US/oxmlsdk/thread/6c2e4dcb-38fc-426e-80fd-cd0f73eda05d
Details:
For example when I copy styles in the style.xml from the template to docx, it obviously alter some of the attributes which were originally written in the document's style.xml; For example the rsId attribute within document style will be replaced by that of in the template when a copy happens. So is this approach of directly copying the style definition is a feasible one? If yes, what are its implications and what other things we need to be aware of if we need to do the xml manipulations ourselves?
Note I am trying it in the Java.
Thanks.
All Replies
-
Monday, March 11, 2013 10:44 AM
Also when I say copy, it is copy done programatically in the server side.
-
Wednesday, March 13, 2013 9:02 AM
Here's a walkthrough on document styles.
How to: Create and add a paragraph style to a word processing document (Open XML SDK)
-
Wednesday, March 13, 2013 11:44 AM
Hi Wilson Taylor,
Thanks for the response.
I am not looking to create my own styles in docx but trying to copy them from a template. As I mentioned it seems to work (meaning the style gallery shows the exact same styles that of template) when I do a copy of style.xml from template to docx but it also replaces many aspects (like rsIds) which was residing in the original style.xml of docx. I was wondering if this has any implications (though it seem to work in the test of opening the document) but I am wondering whether this could have any implications in certain scenarios I am unaware of..
I hope that my question is clear.
Thanks.
-
Friday, March 15, 2013 5:33 PMModerator
Hi gpbk
Could you give us an example of the kind of thing you're worried about?
Since styles are identified by a string, rather than an index number (as in Excel) there shouldn't be any problems in that regard. Only if the styles.xml you're copying wouldn't have a style name that's been used in the document - that could possibly cause a problem (although my instincts tell me Word might simply use "Normal").
Cindy Meister, VSTO/Word MVP, my blog
- Marked As Answer by Quist ZhangMicrosoft Contingent Staff, Moderator Thursday, March 28, 2013 3:19 AM
-
Thursday, March 28, 2013 3:19 AMModerator
Hi Guru K,
I temporarily marked the reply as answer. You can unmark it if it provides no help.
Please feel free to let us know if you need any help.
Have a nice day.
Quist Zhang [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

