Custom properties in word

Insert Fields in a Microsoft Word Document to Display Variable Content

by Avantix Learning Team | Updated January 10, 2021

Applies to: Microsoft® Word® 2010, 2013, 2016, 2019 or 365 (Windows)

You can insert built-in or custom fields in Word documents to display variable content that will change when you update the fields. Some fields (like page numbers, merge fields or cross-references) are inserted automatically when you use Microsoft Word features. If you want to insert custom fields, you will need to create custom document properties.

By default, Word displays the result of a field rather than its field codes. You can right-click a field and select Toggle Field Codes to display field codes or field results.

Recommended article: How to Hide Comments in Word (or Display Them)

Do you want to learn more about Microsoft Word? Check out our virtual classroom or live classroom Word courses >

If you are working with fields in Microsoft Word, you will be using quite a few function keys (such as F9). On some laptops, you will need to press the Fn key on your keyboard to enable your function keys. For example, instead of pressing F9 to update a field or fields, you would press Fn + F9.

Inserting built-in fields

To insert a field, click Quick Parts in the Text group on the Insert tab in the Ribbon. The Field command appears in the Quick Parts drop-down menu as follows:

Microsoft Word Quick Parts drop-down menu with Field command to insert a field.

Below is the Field dialog box in Microsoft Word with Page selected:

Microsoft Word Field dialog box to insert or edit fields.

To insert a built-in field using the Field dialog box:

  1. Navigate to the location in the Word document where you want to insert a field.
  2. Click the Insert tab in the Ribbon and then click Quick Parts in the Text group. A drop-down menu appears.
  3. Select Field. A dialog box appears.
  4. In the list of Field names, select a field. You can filter the list by clicking the down arrow in the Categories list and selecting a category first. Select All to display all fields.
  5. Under Field properties, select any properties or options you want.
  6. To view the codes for a field in the Field box, click Field Codes. For some fields, this button is clicked by default.
  7. Ensure that Preserve Formatting During Updates is checked so that formatting you apply is not removed when the fields are updated.
  8. Click OK. The field is inserted into the document.

Format the field results by applying text formatting to the field using the Home tab in the Ribbon.

You can view or hide all field codes in your document by pressing Alt + F9. Field codes appear between braces or curly brackets { } and you cannot type these braces. Be sure to hide the field codes again by pressing Alt + F9.

To edit a built-in field in the Field dialog box:

  1. Right-click the field and then click Edit Field. A dialog box appears.
  2. Change the field properties and options.
  3. Click OK.

Understanding Word document properties

There are 3 different types of document properties in Word:

  • Standard document properties (also called built-in document properties)
  • Custom document properties
  • Document library properties

Word documents contain a set of standard document properties such as Title, Author, Keywords and Comments. These properties are used to store metadata about your document. You cannot change the name of standard properties but you can edit the value of some of them (such as Title). Other standard properties that cannot be edited store data that is updated automatically (such as Size or Last Modified).

Document library properties are related to documents that are stored in a document library on a website or in a public folder (such as files in SharePoint).

In addition to the standard properties, you can create your own custom document properties. These properties can be created to store additional information in a document other than the standard document properties.  For example, custom document properties could be created for Product1, Product2, Product3, Sponsor, Project Manager, Cell Phone or Disclaimer. Each custom document property must be assigned a name, a data type and a value. The four data types are Text, Date, Number and Yes or No.

After you create custom document properties for your Word document, you can then insert them as custom fields.

Adding a custom document property

To add a custom document property:

  1. Open the Word document in which you want to add a custom document property.
  2. Click the File tab in the Ribbon and then click Info on the left. Info is usually selected by default.
  3. On the right side of screen, click Properties. A drop-down menu appears.
  4. Select Advanced Properties. A dialog box appears.
  5. Click the Custom tab in the dialog box.
  6. Type a name for the custom document property in the Name box. You can also choose one of the other properties that appear in the drop-down list.
  7. Select Text, Date, Number or Yes or No as the data type for the custom property.
  8. Enter a value for the property in the Value box.
  9. Click Add. The custom property appears in the list at the bottom of the dialog box.
  10. Click OK.

After you have added a custom document property, you will be able to insert it into your document as a field.

In the example below, we’re adding a field for Project Manager:

Advanced properties dialog box to add custom field in Microsoft Word.

After you click Add, the custom field appears in the Properties list:

Advanced properties dialog box in Micorsoft Word with custom property added.

Inserting custom document property fields

The value of a custom document property can be inserted in a Word document using DocProperty fields. Custom document properties that have been added to a document are saved with the document whether they are inserted as a DocProperty field or not. You can insert DocProperty fields multiple times in a document.

To insert a custom document property field using the Field dialog box:

Navigate to the location in the Word document where you want to insert a field.

  1. Click the Insert tab in the Ribbon and then click Quick Parts in the Text group. A drop-down menu appears.
  2. Select Field. A dialog box appears.
  3. In the list of Field names on the left, select DocProperty.
  4. Under Field properties, select a property name.
  5. To view the codes for a field in the Field box, click Field Codes. For some fields, this button is clicked by default.
  6. Ensure that Preserve Formatting During Updates is checked so that formatting you apply is not removed when the fields are updated.
  7. Click OK. The field is inserted into the document.

In the example below, we’re inserting the custom Project Manager field we created in Advanced Properties:

Insert field dialog box in Microsoft Word to add a custom field.

Updating built-in and custom fields

Word should automatically update fields when a document is opened. Many fields are also updated automatically when you go to Print Preview (click the File tab and then click Print). If you prefer, you can update fields manually.

To update a field manually, right-click the field and then click Update Field or press F9.

To update all fields manually in the main body of a document, press Ctrl + A to select all and then press F9.

Some fields in headers, footers or text boxes must be updated separately. Click in the header, footer or text box, press Ctrl + A to select all and then press F9. Page fields do not need to be updated manually because they update when you go the Print Preview.

If you want to edit a custom DocProperty field, you will need to edit it in the Advanced Properties dialog box.

Subscribe to get more articles like this one

Did you find this article helpful? If you would like to receive new articles, join our email list.

More resources

How to Create, Save, Edit and Use Templates in Word

How to Insert, Format and Update Cross-References in Word

5 Ways to Insert the Division Symbol in Word (Type or Insert ÷)

10 Microsoft Word Tips, Tricks and Shortcuts for Selecting in Tables

How to Create a Table of Contents in Word (Insert, Format and Update a TOC)

Related courses

Microsoft Word: Intermediate / Advanced

Microsoft Excel: Intermediate / Advanced

Microsoft PowerPoint: Intermediate / Advanced

Microsoft Word: Long Documents Master Class

Microsoft Word: Styles, Templates and Tables of Contents

Microsoft Word: Designing Dynamic Word Documents Using Fields

VIEW MORE COURSES >

Our instructor-led courses are delivered in virtual classroom format or at our downtown Toronto location at 18 King Street East, Suite 1400, Toronto, Ontario, Canada (some in-person classroom courses may also be delivered at an alternate downtown Toronto location). Contact us at info@avantixlearning.ca if you’d like to arrange custom instructor-led virtual classroom or onsite training on a date that’s convenient for you.

Copyright 2023 Avantix® Learning

Microsoft, the Microsoft logo, Microsoft Office and related Microsoft applications and logos are registered trademarks of Microsoft Corporation in Canada, US and other countries. All other trademarks are the property of the registered owners.

Avantix Learning |18 King Street East, Suite 1400, Toronto, Ontario, Canada M5C 1C4 | Contact us at info@avantixlearning.ca

We recently showed you how to set the user information in Word. Word also stores several additional advanced properties related to your documents. Some of these are displayed on the “Info” screen and you can change these properties, as well as create custom properties.

Custom properties can be created to store additional information about the document not available on the “Summary” tab of the “Advanced Properties” dialog box. If you have phrases or words you use often throughout your document that may change between the first and final drafts, setting up some custom properties you can insert into your document can be useful. You can change the value of the property in one place and it will propagate through your document.

NOTE: We used Word 2013 to illustrate this feature.

To create a custom property, click on the “File” tab while in an existing or new Word document.

On the backstage screen, make sure the “Info” screen is active. If not, click “Info” in the list of items on the left.

On the right side of the “Info” screen, click the “Properties” button and select “Advanced Properties” from the drop-down menu.

A dialog box displays with the filename (without the file extension) as the title. Click the “Custom” tab.

You can choose one of the pre-defined custom properties from the list at the top of the tab. If the property you want is not in the list, type a name for the custom property in the “Name” edit box above the list. Select the type of data for the custom property (Text, Date, Number, Yes or No) and enter a value for the property in the “Value” edit box. Click “Add”.

Your custom property with the “Value” and “Type” is added to the “Properties” list. Click “OK” to close the dialog box.

You won’t see the added custom property on the “Info” backstage screen, but you can insert it into your document using a field. We will discuss how to do this in a future article.

READ NEXT

  • › How to Insert a Word Count into Your Word Document
  • › How to Insert Built-in and Custom Advanced Properties into a Word Document
  • › How to Add Document Properties to a Header or Footer in Microsoft Word
  • › Google Chrome Is Getting Faster
  • › This New Google TV Streaming Device Costs Just $20
  • › BLUETTI Slashed Hundreds off Its Best Power Stations for Easter Sale
  • › HoloLens Now Has Windows 11 and Incredible 3D Ink Features
  • › The New NVIDIA GeForce RTX 4070 Is Like an RTX 3080 for $599

How-To Geek is where you turn when you want experts to explain technology. Since we launched in 2006, our articles have been read billions of times. Want to know more?

Information about your document is available in the Advanced Properties dialog box. But, you can also add custom properties. Word allows you to store the additional information in your document. We will show you in step-wise instructions how you can add custom document properties.

Let us start.


Step #1: Open the Word document.

Open the Word document in which you want to add the custom information.

Step #2: Open the Info section

Click on the File tab in the top menu bar to open the File menu.

In the left-hand section, click on the Info tab to change the display in the right-hand section.

In the right-hand section, click on the Properties tab to display another tab, Advanced Properties.

Click on the Advanced Properties tab.

This will open the Advanced Properties dialog box. Click on the Custom tab.

Step #3: Enter Custom property

Under the section Name, search for the property you want to add.

You can also type the name of the property in the empty box on the right of Name:.

On the right side of Type:, select the type of property you are entering: 

  • Text
  • Date
  • Number
  • Yes or No

Type the value in the box on the right-side of Value:.

Click on the Add tab to add the property.

Word adds the new document property in the last line under Properties.

The custom property you have added may not be visible on the Info screen.


Conclusion

We have shown you how you can add custom document properties to your Word document. Insert the property into your document using a field function.

На чтение 2 мин Опубликовано 14.10.2015

Добавляем пользовательские свойства в Word

В одной из статей мы показывали, как добавить информацию об авторе к документу Word. Помимо этого, Word хранит ещё несколько расширенных свойств, связанных с документом. Часть из них отображается в окне Сведения (Info). Их можно изменять, либо создавать собственные пользовательские свойства.

Пользовательские свойства могут создаваться для хранения дополнительной информации о документе, которой нет на вкладке Документ (Summary) в диалоговом окне Дополнительные свойства (Advanced Properties). Если в документе есть какие-то фразы или слова, которые часто используются и могут измениться пока документ проходит долгий путь от первой и до последней редакции, настройка некоторых пользовательских свойств, которые можно вставлять в документ, может оказаться весьма полезной. В таком случае достаточно изменить значение свойства только в одном месте, а изменение произойдёт во всём документе.

Примечание: Иллюстрации для этой статьи взяты из Word 2013.

Чтобы создать пользовательское свойство, откройте существующий (или создайте новый) документ Word и перейдите на вкладку Файл (File).

Добавляем пользовательские свойства в Word

Должно открыться окно Сведения (Info). Если это не так, кликните по одноименной кнопке в списке разделов слева.

Добавляем пользовательские свойства в Word

Теперь нажмите кнопку Свойства (Properties) и из выпадающего меню выберите Дополнительные свойства (Advanced Properties).

Добавляем пользовательские свойства в Word

Появится диалоговое окно с именем файла (без расширения) в заголовке. Перейдите на вкладку Прочие (Custom).

Добавляем пользовательские свойства в Word

Вы можете выбрать одно из готовых настраиваемых свойств в списке в верхней части вкладки. Если нужного свойства там нет, введите название для пользовательского свойства в поле Название (Name) над этим списком. Выберите, какой тип данных будет храниться в созданном свойстве: Текст (Text), Дата (Date), Число (Number), Да или Нет (Yes or No), и введите значение свойства в поле Значение (Value). Нажмите Добавить (Add).

Добавляем пользовательские свойства в Word

Пользовательское свойство, а также его значение и тип, появились в списке Свойства (Properties). Нажмите ОК, чтобы закрыть диалоговое окно.

Добавляем пользовательские свойства в Word

Созданное свойство не появится в окне Сведения (Info), зато Вы сможете вставить его в документ, используя экспресс-блок Поле (Field). В одной из статей мы рассказываем об этом подробнее.

Оцените качество статьи. Нам важно ваше мнение:

  • Question

  • HI..

All replies

  • Select File > Info.

    On the right hand side, click Properties > Advanced Properties.

    Activate the Custom tab.

    Type a name, select a type, and enter a value if desired, then click Add.


    Regards, Hans Vogelaar

  • I tried but doesnt show on document property list

    can you try?

  • To reference the property via a DOCPROPERTY field in the document, go to the document itself (not a dialogue), press Ctrl-F9 and type ‘DOCPROPERTY test’ between the field braces (ie {DOCPROPERTY test}), then press F9 to update the field.


    Cheers
    Paul Edstein
    [MS MVP — Word]

    • Edited by

      Wednesday, August 1, 2012 5:23 AM

  • Hi,

    Based on my research, this should be done with Microsoft Office InfoPath.

    The properties that appear in the Document Information Panel can’t be changed unless you add custom properties by using a property management server or a Microsoft Office InfoPath form.
    You can add some custom properties by clicking Advanced Properties in the upper left of the Document Information Panel, but the properties will not appear in the Document Information Panel or in the document itself.

    1. Click the File ->Info->
      Properties->Show Document Panel

    The Document Information Panel opens above your document.

    1. Fill out the property information that you want to keep with your document.

    Notes :

    • The Required field flag appears only with properties that are bound to documents that are stored on property management servers. Built-in properties are never required for a document.
    • You can add custom properties to the Document Information Panel if you are using a property management server, such as Microsoft Office SharePoint Server, and Office InfoPath.

    Here’s the link to refer:

    http://office.microsoft.com/en-us/help/add-property-information-to-a-document-HA010163766.aspx

    The link is for Word 2007. I have changed the steps in the above information for Word 2010.

    The following link is about “Design a Document Information Panel by using InfoPath”, but it is also applies to InfoPath 2007, you can refer:

    http://office.microsoft.com/en-us/infopath-help/design-a-document-information-panel-by-using-infopath-HA010201967.aspx


    Jaynet Zhang

    TechNet Community Support

  • Hi Jaynet,

    Many of us have been creating & referencing custom document properties since way before InfoPath existed. There is no need to use InfoPath to do so now.


    Cheers
    Paul Edstein
    [MS MVP — Word]

    • Edited by
      macropodMVP
      Wednesday, August 1, 2012 6:44 AM

  • Hi paul,

    Not working

    • Edited by
      MGerio
      Wednesday, August 1, 2012 7:13 AM

  • Your ‘Error! Unknown document property name’ message suggests you have mis-typed the property name, or you’re using it in a document that doesn’t have the ‘test’ document property.

    The bookmark error messages suggest you’re trying to reference an non-existent bookmark — document properties are not bookmarks.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • Your DOCPROPERTY field should look like what I posted:

    {DOCPROPERTY test}

    Simply having { test } creates nothing more than a bookmark reference. That ain’t gonna fly…

    Because it’s a custom property, all you’ll see in the document after updating is the field’s value:

    test


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • Create a custom document property:

    To insert a DOCPROPERTY field, either use Insert > Quick Parts > Field…, or use Ctrl+F9 as described by macropod.


    Regards, Hans Vogelaar

  • That looks about right.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • All document properties on the ‘Custom’ properties tab are editable/customizable. To
    create or change a property, you access it via the dialogue box or via vba. To
    reference them, you use DOCPROPERTY fields or vba.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • Can document custom property be inserted, edited and look like this?

  • Can document custom property be inserted, edited and look like this?

    No, not as far as I know. Edit in the Document Properties dialog, display through a DOCPROPERTY field.


    Regards, Hans Vogelaar

  • How sad..

    however… I noticed that when i close the word program and reopen a new instance, my custom Doc property are gone.

    But on the document itself where i put my custom doc property, items are retained.

    why is that so?

    • Edited by
      MGerio
      Thursday, August 2, 2012 5:21 AM

  • Custom document properties are stored, as the name indicates, in the document (or template). They will not be available elsewhere.


    Regards, Hans Vogelaar

    • Marked as answer by
      Jaynet Zhang
      Tuesday, August 7, 2012 1:43 AM
    • Unmarked as answer by
      MGerio
      Saturday, August 18, 2012 4:59 AM

  • There are now two sorts of «Custom Document Property» in Word:

    The old sort, where you create/maintain them in the «Advanced Properties»->Custom dialog pane, and insert them using
    DOCPROPERTY fields. These are not displayed in the «Document Property» drop down you display in your original post.

    The new sort, which are the sort that Jaynet Zhang describes. These are typically, but not necessarily, related to columns created in a SharePoint library. When a document is opened from Sharepoint, Sharepoint inserts information about the names and values
    of these columns in Word. Their names then appear in the Document Property dropdown. When you insert one of the Properties from this dropdown, Word inserts a
    Content Control that is linked to the value of the property. However, not all the names in that dropdown are related to SharePoint properties — some are «Builtin» Properties such as Author, and others come from a special set of «Cover Page Properties»
    introduced in Word 2007 (Company fax, etc.)

    Arguably the first sort of Property is the «true» «Custom Document Property», but since the second sort are also described as «Document Properties» and can be user-created (by a SharePoint user), and do not seem to have a well-established name, people not
    unnaturally refer to them using the same name as the first sort. Sometimes they are referred to as «Server Properties»

    Using VBA or other coding techniques, it is theoretically possible to set up «Server Properties» without either Sharepoint or InfoPath by creating some chunks of «Custom XML» (another reason why the word «Custom» is sometimes used for these properties).
    However, without the server present, these properties do not work in quite the same way as the «real thing» — e.g., with the server present, there is more validation.

    The thing about «Server Properties» and the other properties on the dropdown is that each Content Control is linked to a specific property held in the document’s XML. If you have more than one content control linked to the same property value, when the property
    value is updated, the value in each of the linked Content Controls is updated automatically. That does not happen with DOCPROPERTY fields, and unfortunately it is

     a. not possible to link a Content Control directly to the value of the old type of Custom Property.

     b. either not possible, or not easy, to include DOCPROPERTY fields in the dropdown.

    So which type of control you choose depends on what you are trying to achieve, and the environment you are working in. 


    Peter Jamieson

    • Edited by
      Peter Jamieson
      Thursday, August 16, 2012 8:32 AM
      content control->custom property in point (a)
    • Proposed as answer by
      Hunter.CHEN
      Wednesday, March 2, 2016 4:56 AM

  • Thanks Peter. Very informative.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • I Wonder..

    Engineer is not listed in default document property but I received a document with this doc property:

    How Do I create this?

  • Let’s step back.

    There are several ways to show «repeating data» in Word documents. Greg Maxey documents most of them at
    http://gregmaxey.mvps.org/word_tip_pages/repeating_data.html 

    You may find it useful to have a look around his site, particularly this page:
    http://gregmaxey.mvps.org/word_tip_pages/mapped_content_controls.html

    What you are showing is a Content Control with some text in it. The text might or might not be the value of a «document property».

    You can make your own Content Controls in the Developer Tab (you can enable it in Word Options). You can modify the title (in this case «engineer») using the Properties button in the Developer tab. And you can type some text into the Content Control.

    At that point you have a Content Control containing some text. I wouldn’t personally call that a «document property,» because to me a property is something that can exist independently of what you put on the document surface. In the case of Word, it is also
    possible to insert copies of the value of most (if not all) types of property on the document surface. For example, you can insert copies of the value of the built-in Author property using an { AUTHOR } field. Others here have described the mechanism you can
    use with DOCPROPERTY fields.

    To do that with Content Controls, you have at least to link the Content Control with a piece of data stored outside the document surface. If someone has done that in this case, you ought to be able to do the following:

     a. copy/paste a copy of the Content Control into your document

     b. edit the text «Nikoli Tesla» in one of the Content Controls (CCs)

     c. click somewhere outside the control. 

    If the content of the other control changes, then the two controls are linked to a piece of data held outside the document surface. In this case, that might have been achieved in a number of different ways, e.g.

     1. someone might have inserted one of the standard Document Properties (e.g. using insert->Quick Parts->Document Property and selecting «Comments»), then modified the Title of the property to be «engineer.» In that case, modifying the value of
    the builtin Comments property would cause the text in the CC to change and vice versa. If so, the document creator has not created a
    new property, just the title used to display it in one part of their document.

     2. someone might have created and inserted a custom XML part containing an element or attribute that contains the text «Nikoli Tesla», created and inserted a Content Control with title «engineer», and linked that control to the XML element/attribute.
     

    At least (2) and probably (1) is/are described in the Mapped Content Controls article referenced above. 

     3. someone might have created the document in a Sharepoint library that has a column defined with the display name «engineer». In that case (unlike the other two cases above), an «engineer» property would probably (but not necessarily) be present in
    the drop down list of Document Properties. These types of properties are the ones sometimes described as «Server Properties», and are not currently covered by Greg in his article (for one thing, they have a more complex XML representation).

    Whether you regard all those things (1), (2), (3) as Document Properties is arguable, really. They are obviously «properties of a document». The main sense in which (1), (3) and the old «Custom Document Properties» differ from (2) is that the way they are
    stored is defined in the ECMA/ISO standards documents for Word .docx type documents.


    Peter Jamieson

    • Proposed as answer by
      Hunter.CHEN
      Wednesday, March 2, 2016 4:56 AM

  • check this link this may help you out

    http://superuser.com/questions/285256/word-2010-how-to-reference-custom-document-properties

  • Its awkward.

    Seems a plain document property name insertion/customization doesn’t have a simple execution.

    Does it have to take a brilliant programmer to have an «add», «modify» or «rename» document property option in Microsoft Word 2010?

    • Edited by
      MGerio
      Wednesday, August 22, 2012 2:47 AM

  • @maan

    Link is same as instruction in earlier replies.

  • Its awkward.

    Seems a plain document property name insertion/customization doesn’t have a simple execution.

    Does it have to take a brilliant programmer to have an «add», «modify» or «rename» document property option in Microsoft Word 2010?

    Word already has the facility to add/modify/delete a Document Property. You do that via the processes already discussed.

    What you seem to not recognise is that what you’re showing is not the Document Property itself but, at most, a reference to it. Of course, if you use a Content Control for maintaining the details, you could use a ContentControlOnExit macro to update the
    Document Property. You could even write code to add/delete such Document Properties via Content Controls, but I wouldn’t recommend it.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • What you seem to not recognise is that what you’re showing is not the Document Property itself but, at most, a reference to it. Of course, if you use a Content Control for maintaining the details, you could use a ContentControlOnExit macro to update the
    Document Property. You could even write code to add/delete such Document Properties via Content Controls, but I wouldn’t recommend it.


    Cheers
    Paul Edstein
    [MS MVP — Word]

         May I join this discussion by asking why nobody
    out there has written the code necessary to add, edit, and delete Document Properties via Content Controls?  This appears to be
    exactly what MGerio asked in the post that he added to this thread on Wednesday, August 1st, 2012 at 12:09 AM in clarifying his original question.  In fact, I need the code too because I need to link a ‘Teacher’ content control in the first
    page header of a short report that I am writing to a custom ‘Teacher’ document property associated with it because MLA style requires this.  Features like this should reside within Word’s standard UI! 

    P.S.:  I hope that the developers of Office 2013 are looking at this thread. 

  • I pointed to Greg Maxey’s site which has a lot of info on this general subject, but a more specific reference that may help you is

    http://www.gmayor.com/BookmarkandVariableEditor.htm

    Beyond that, one way of starting to think about the answer to your own question is to list the barriers that prevent you from creating the software you need. Then consider how much more difficult it might be to create something that is easy and reliable
    for other people to use.


    Peter Jamieson

  • Hi everybody,

    i have a similar issue i’ve been struggling with for quite a long time now, i will try to give you as detailed information as possible, so please excuse my excessive writing.

    I try to find a way to (automatically) enter user information (possibly from our AD) to a .docx concept template into fields or document properties or whatever possible. all of the fields reside on the front page, some of them are placed in the header and footer
    of the document.

    Up to now, my workaround is that i simply inserted document properties and customized them with different titles, tags and styles. the only problem is, that the user has to fill in all of them including going into the header and footer sections to reach some
    of the properties.

    This is what i either want to relocate to the properties section on the info tab, before working in the document, or that i want to be filled out automatically with user information from AD (of course excluding properties that only apply to the actual document
    like customer, project and so on).

    I want to keep the document free from macros and add-ins whenever possible.
    However, i did try vba and even tried some weird add-in and played around quite extensively with document properties and fields, but nothing worked for me the way that i wanted.

    I think it has to be somehow possible to create custom fields/document properties/whatever on the front page (including header & footer) where then, when opening the document, the first thing the user should do would be typing in his or her properties on
    the file tab —> info.
    There the user should be able to also fill in customized properties like «customer», «project name»or «type of document» without having to create custom properties each time they open the template document.

    Is that possible in any way? And if so, can this be done with just fields or with document properties? i’d like to have a different style attached to each property. For example, «customer» is big and bold, whereas telephone number and email are plain and simple.

    I’m no expert in directory services and also not in Word but i wonder why there’s no easier built-in way to reference customized document information or any possibility to automatically retrieve user information from Active Directory. I’m sure that lots of
    customers would be pleased to solve this without vba or third party add-ins..

    Again, sorry for the letter, i hope someone can share some ideas on this.

    Thanks,
    Stufe

  • Dear macropod,

    This is great option but, for some reason, this «DocProperty» acts as standard «CustomProperty» which is limited to 255 characters.

    If I use one of the «quick parts»—> «Document properties» such as «Manager, I can fill this property with Unlimited number of characters and also put some «Enters»…

    Is there any option to define this DocProperty to be able to filled with more than 255 characters?

    Thanks,

    Orion Lidji..

  • AFAIK, no — the limit is 255 characters.


    Cheers
    Paul Edstein
    [MS MVP — Word]

  • Hi guys,

    2 years later, and I’m trying to achieve exactly this. Thanks for your answers Peter, very interesting.

    Based on your posts and your link (http://gregmaxey.mvps.org/word_tip_pages/mapped_content_controls.html), I understand that it is possible to bind a Content Control only
    to a builtin Document Property. It is not possible to bind them to a Custom Document Property.

    One question: does anyone know if this has improved in Word 2013? Because the Content Control is so much userfriendly than {docproperty}/F9/and so on… And it is a little complex if I must have a Sharepoint server to be able to add metadata to my Word document…

  • As far as I know the situation is the same in 2013, i.e. the main differences in that version are to do with other aspects of content controls (new mapping UI, mapping of rich text controls, repeating groups). 


    Peter Jamieson

  • Ok thanks for your answer!

  • This is an excellent thread. I love how painstakingly and patiently mgerio walks through all replies and leads back to the original issue, time and time again — sometimes even using several replies. He will not be deterred or allow the thread to be repurposed
    or construed off topic! I love the informative and valuable replies by everyone, including Peter Jamieson (despite some oddities, IMNSHO). 

    Great summary of the need by RandomDSDevel. This is a could-have-been-fantastically-awesome-and-usable feature that stopped half-way, half-baked. Just opening that Quick Parts drop down makes me sad thinking of how good it could have been, the way I and
    many others thought it would work the first time we tried it out — so close… so close… :-)

  • hi, 

    i am not able to enter more than 255 character in value field. if any settings available let me know pls..

  • hi, 

    i am not able to enter more than 255 character in value field. if any settings available let me know pls..

    As has been pointed out in this thread, the maximum length of a custom document property is 255 characters. This cannot be changed.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • This one provides the most useful tool on the content control. Thanks a lot

  • Hi Hans
    Re: Custom Quick Parts ~ Do you know how the values are seen by other applications that use MetaData? Do these custom quick parts variables show up?

    I’d like to prepare files to be uploaded into a DMS, by creating a smart coversheet that contains meta data.
    The QuickParts are a great start but they don’t cover all the basics.  I was using Sharepoint as a DMS, but not anymore, the IT guys are thinking of procuring something else.  Thank you very much for any direction you can give.

  • I am not Hans, but (a) different types of property are stored in different ways, and (b) there are at least three possible ways to extract them, at least from a .docx:
     — Using the Word object model or .NET Interop, you can probably extract most, if not all of them, at least on Windows Word
     — You may still be able to extract the builtin properties and old-style Custom Document Porperties using the dsofile DLL (have a look around)
     — By digging around in the individual XML parts that make up a .docx file

    There may also be third-party libraries that will do those jobs for you, but I am not familiar with any of them.

    Using the Word object model, you can get at
     — the traditional built-in properties via a Document’s BuiltInDocumentProperties property

     — the traditional custom properties via a Document’s CustomDocumentProperties property

     — the «Cover Page Properties» by identifying the Custom XML Part that contains those properties and using XPath or other code to retrieve individual values.

     — *most* SharePoint type properties via a Document’s ContentTypeProperties collection property.

     — (if you take the view that Word Document Variables are «properties», you can get them via the Document’s Variables collection).

    The dsofile DLL is a Win32 DLL that let you retrieve builtin properties and old-style custom document properties. I don’t know what its status is now, and I doubt if it was ever expanded to include any other property types.

    If you want to get them straight from the .docx, a .docx is a .zip that contains its own file structure. You can unzip it and look at the individual .xml files, or use an API such as the .NET packaging API or the Office Open XML (OOXML) API to access the content.
    In principle, you have to discover the existence and location of each part using the [Content_Types].xml file in the .docx. In practice, documents created by Word always put the parts in the same folder structure within the file. But the broad-brush picture
    is that
     — the built-in properties are stored in 2 XML parts: core.xml and app.xml.
     — Old-style Custom document properties are stored in custom.xml.
     — Cover Page properties are stored in an itemsn.xml part in the CustomXml folder (e.g. items1.xml)
     — Sharepoint properties are stored in one or more itemsn.xml parts in the CustomXml folder, and a set of Sharepoint-generated XML schemas is stored in a nother part.
     — Document Variables are stored in the settings.xml part.

    If you have also to deal with .doc format  documents, you can access old-style properties as above. I forget what the situation as far as newer property types are concerned — AFAICR Sharepoint metaproperties are stored as old-style Custom-Document properties.
    Your best bet with .docs is probably to open them in interop, save them as .docx format, and use those to discover properties (unfortunately, that will change some of the date/time ones), even if you need to store the .doc rather than the .docx. In principle,
    it is possible to examine a .doc programmatically (that’s obviously what non-Microsoft converters do, so you may find useful libraries out there).


    Peter Jamieson

  • HI..

    What are shown here are not, exactly, document properties, I think. They are mapped content controls, for the most part mapped to document properties. You cannot add to this list or subtract from it. You can change the names of the properties. See Greg Maxey’s
    Repeating Data for information on how.

    The only one that I know is not a traditional document property that can be displayed with the DocProperty field is Abstract.

    Edit: Peter examines all of these in his spreadsheet. Abstract is not the only one in the document property list that is not a content control linked to a «document property» as that term has been used in the past. They are all mapped content controls
    and that does make them useful.


    Charles Kenyon Madison, WI

    • Edited by
      Charles Kenyon
      Thursday, March 10, 2016 2:52 PM

  • Charles:

    The items on the list will indeed insert content controls mapped to Document Properties, except for 5 which are mapped to a Custom XML Part containing Cover Page Properties, which is a namespace «known to» Word.

    AFAIK the only way to get anything else into the list is either to create Document Library/List columns in Sharepoint, and download adocument from that library. At that point, Sharepoint generates some more Custom XML Parts that (a) describe the metadata it
    has inserted (in the form of a few XML Schemas) and (b) contain the data. Word also recognises that stuff and generates new entries for the dropdown. Such data can also appear in the «Server Properties Document Information Panel», that is (or was
    — AIUI it has gone in Word 2016, but I haven’t looked) a pane displayed by some InfoPath code, and accessed through a Document’s «ContentTypeProperties» collection. SOme of my other posts in this conversation touch on some of these subjects.

    Strictly speaking, you do not need SharePoint to do that — as long as you create Custom XML Parts with the appropriate structures, Word will add entries to the list. But I do not think it can be recommended because of the issue of what happens if, for example,
    you create all your own SharePoint property data, then actually upload the document to a SharePoint folder with different property data.

    I don’t think Greg and Graham have ever (publicly) touched on the SharePoint side of things, but I am not particularly up-to-date with their material. As for the standard and cover page properties, they must have developed a list when developing one of their
    utilities. You might find my own list useful — it’s temporarily at

    https://www.dropbox.com/s/zt062h1i1hgwcbc/WordCoreExtendedCoverPageProperties.xlsx?dl=0

    and demonstrates a number of anomalies. I doubt if it is error-free!


    Peter Jamieson

    • Proposed as answer by
      Charles Kenyon
      Thursday, March 10, 2016 1:17 PM

  • Thank you Peter. Great Answer.

  • Thank you for sharing this Peter.

    Greg, in his Repeating Data page notes that it is possible to relabel these using the content control properties. That works very well if you want to do a quick and dirty mapped content control in a document or template. Here is a screenshot using a renamed
    Category document property.

    I wish very strongly that MS had not mixed up a bunch of stuff and put it under the label «Quick Parts.» What is done, is done.


    Charles Kenyon Madison, WI

  • A content control inserted using Quick Parts > Document Property > Author will look like that. A DocProperty field is what is described by Paul Edstein. This is an instance of Microsoft using the same term to describe related but different features.
    Some of the content controls inserted using Quick Parts > Document Property use document properties, others do not.

    So, the field {DocProperty Author} will reflect the content put in the Content Control. It will also show up if you look at the document properties pane. On the other hand, the Content Control for Abstract will not be reflected in any DocProperty field nor
    does it show up in the Document Properties pane.

    See the post by Peter.


    Charles Kenyon Madison, WI

  • Can document custom property be inserted, edited and look like this?

    No, but as explained in Greg Maxey’s
    Repeating Data (Populating Multiple Like Fields) these content controls inserted through Quick Parts > Document Property can be retitled and repurposed. Once you do that, you can copy it to another part of your document and it will replicate the content
    using the same title. The name in the drop-down list, though, will not change. If you change the title of Company to «Client» a copy of that content control will show the title «Client» but it will still be Company in the drop-down.


    Charles Kenyon Madison, WI

  • I Wonder..

    Engineer is not listed in default document property but I received a document with this doc property:

    How Do I create this?

    This is not a document property, but a Content Control. It may or may not be «mapped» to an XML node.
    Word Content Controls


    Charles Kenyon Madison, WI

  • hi, 

    i am not able to enter more than 255 character in value field. if any settings available let me know pls..

    The maximum length of a custom document property is 255 characters. The maximum length of a DocProperty field result appears to be the same. I do not know of a maximum length for a content control inserted using Quick Parts > Document Property. I have
    had it exceed a page in length. When that content control is inserted in another place, it holds all the original content whether inserted through the drop-down or through copy and paste.

    Using the Category content control from the Document Property list in Quick Parts I added a page of material that was reflected in the Category property on the Document Properties pane. However, the field {DocProperty Category} only gave 255 characters from
    it.

    Again, Microsoft is using the term «Document Property» to refer to different  Word features. The Quick Part refers to a Content Control that may be related to a document property.


    Charles Kenyon Madison, WI

Понравилась статья? Поделить с друзьями:
  • Custom properties in excel
  • Custom lists in excel
  • Custom lines in word
  • Curved writing in word
  • Custom function in excel