When working with Microsoft Word, a great part of administrative tasks consists in filling forms and generating reports on a pre-established templates or models. Now if within your document you have recurrent data (like customer name, company name, etc.) filling the document will be much easier if we would be able to enter this data in only one location and then populate the document automatically.
This article will introduce the use of the custom properties of a Microsoft word document. The idea is to create these properties according to our needs, insert empty fields in the document corresponding to the already created properties in the exact locations where we want them to appear. Finally we will enter the values for our properties and update the document.
Let’s imagine we have a letter template we send to clients, in this letter we should put the sender name, the recipient, his customer number and his address, this data is repeating all over the document and it wouldn’t be nice if we forget one location with a previous customer data!
Let’s begin by creating our custom properties, first go to <Document Properties> (wherever you can find it depending of office version you own, here is a capture taken from Word 2007):
You can see some of the default properties like Author, Title and so on, go to <Advanced properties>
And then to the <Custom> tab.
We will create our first custom property: In the <Name> textbox, type Sender_Name. We should fill the <Value> textbox otherwise Word will not accept it. Leave the <Type> textbox as is (Text). Validate by pressing the <Add> button, don’t close the form, and add the other properties.
You will end up with the following:
Let’s insert our empty data as fields in the corresponding locations in our document: close the <Document properties> bar, go to <Insert><Quick parts><Field…> and select the <Document information> under category and <DocProperty> under <Field names>, look for Sender_Name, do not forget to uncheck the <Preserve formatting during updates> checkbox so that when you update the fields, formatting will stay unchanged:
Redo this for all the custom properties we defined, later in the document you can copy/paste fields to other locations rather than inserting them once again, you can change their format, font, etc. as you like and your final document will be like this:
It’s time now to insert our actual data: save your document, you will use it whenever you have to use the same model. Go back to <Advanced properties> again and replace the values of our custom properties (the #Empty ….#) by the actual data, press the <Modify> button after each field change. After finishing, select all the contents (Ctrl+A) and press <F9> key (this will update all our fields with the new typed values of our custom properties). Save as the document with another file name, here how it should look:
Nice, isn’t it?
See also - Voir aussi :










{ 12 comments… read them below or add one }
Thank you very much,,,,,,,,,,,,
it’s workin fine except 4 one prop, no way to have more than one line, it’s displayin only the first line when i paste?
@wayne19: hmm … you’re right, Word does not allow to enter a multiline text in the property textbox, but there must be another way ???
@wayne19: Check this out
hi,
i did exactly what you are stating but when i “select all the contents (Ctrl+A) and press <F9>” nothing happens!?
After finishing, (Colse that window and go back to the document) select all the contents (Ctrl+A) and press key (this will update all our fields with the new typed values of our custom properties)
Yeah, that was not clear
Thank you SO much. I have been looking everywhere for a simple, clear explanation on how to utilize this feature, and haven’t had any luck until I found your blog. You are a lifesaver!
@Alison : I’m glad you found it, please have also a look here to overcome some problems of this method.
I didn’t know Bon Jovi and Axl Rose wrote to each other. Maybe they’re actually lovers in secret? LOL
@Dennison Uy: Yeah that’s good music
Can you set the custom fields in the Normal.dot template so that they are used all the time?
Unfortunately not, Normal.dot/dotm can be modified and saved but changes do not appear on newly created documents. You can still use predefined properties (there’s a lot of ‘unused’ ones), I know it’s not sexy to use a field called ‘Author’ as ‘Invoice Number’, but “so what?”