In Word 2010, how can I insert a control that updates a document property when the content is edited?
In Word 2010 you can insert document properties from the Insert ribbon. For example:
Insert > Text > Quick Parts > Document Property > Subject
If you do this a control will be added with the following placeholder text:
[Subject]
Notice the square brackets around the word Subject. These square brackets are not present in the placeholder text for manually inserted controls (which can be inserted using the Developer ribbon).
When a user opens the document, replaces the placeholder text with his own text, the document metadata is updated. This behavior is different from a field which can only be updated by first updating the metadata.
Unfortunately the range of document properties that can be added to the document is limited, and I would like to add other (custom) properties this way as well.
How can I manually insert a control that will update document metadata with the content entered in the control?
I know this is a long time since this question was asked, but is is actually possible by adding a custom XML part to your document :)
-
Create a xml file with the properties you want (you can make this as many levels as you like)
XML exampel:
<?xml version="1.0" encoding="utf-8" ?> <properties xmlns="CustomDocumentPropperties"> <document> <documentNumber></documentNumber> <documentCategory></documentCategory> </document> <employee> <name></name> <hireDate></hireDate> <title></title> </employee> <company> <address></address> </company> </properties>
Save the file as xml e.g. "MyProperties.xml"
-
Add the xml file to your document (only tested in word 2013 but should be possible in 2010)
Developer -> XML Mapping Pane
(if your developer ribbon is not visible you can find it in File -> Options -> Costomize Ribbon, and set checkmark in the Developer ribbon tab)
In the XML Mapping Pane click the drop down box and choose 'Add new part...' and select the XML file you just created.
-
Use the properties in your document
Now your properties has been added to the document and you can use them by selecting your properties in the XML Mapping Pane.
Right-click on the property you want in your document, and choose 'Insert Content Control' and choose the Content Control you like to edit your properties.
Cheers Stine
This was one of the suggested edits that an anonymous user tried to append to your question. I rejected the edit, but thought of adding it as an answer to your question. See if it helps:
1-In word 2010, File Menu Tab --> Info--> properties Command --> Advanced Properties 2-From Document Properties Window --> Custom Tab
Here you can add new control and assign to it Type and Value.
Now to add this control to your document
1-Insert tab-->text group-->Quick parts command-->Field 2-From Field Window-->Categories drop-down list-->choose Document Information 3-Choose the Field name "DocProperty" 4-From the property Section Choose the Field Name you just added. 5-Choose OK
I've found a way to do this, in Word 2007 at least. Not quite in the same way as the already defined document properties, and I don't know how well it show up outside of Word, but it at least does appear to fit the bill for an updatable property field....
First type your text that you want to make into an updatable document property and create a bookmark for it. Effectively just select the text then go to
Insert -> Links -> Bookmark
then enter the bookmark/property name you want and click Add
Next click the "Office" button and get to the advanced document properties:
Office -> Prepare -> Properties
In the Subwindow that opens:
Click `Document Properties` and select `Advanced Properties`
This will give you the following window, in which you can go to the Custom
tab and if you enter your Bookmark name, click Link to content
and then Add
will give you a custom property that will always show the contents of that field in the document.
Whether this does exactly what you are wanting I'm not completely sure, as it does seem a bit limited and messy, but it does at least seem to get somewhere near.
Hinted at by Microsoft