Adding document properties

This page contains:

One of the most common features you'll add to your template is a custom property.

Custom properties allow you to repeat certain information in multiple locations in the report. They are useful for displaying:

  • The client's name throughout different sections.
  • The project name.
  • The document author.
  • ...

Adding new custom properties

Before being able to put our custom properties in different locations of our document, we have to add them:

  • Click the File tab.
  • Click Properties.
  • Click Advanced Properties.
Reports 04

Click on Custom, and add a few properties.

The property Value can be anything as long as it won't be flagged by Word's internal spellchecker.

Reports 05

Inserting custom properties

Now that your template has several custom properties in it, we can place insert them in different locations.

Lets use a common location for this type of content: a table where we list a few details about the document itself:

Reports 06

Lets start with dradis.client. Navigate with the cursor to the cell where you want to insert it.

  1. Click the Insert tab.
  2. Click Quick Parts
  3. Click Field...
Reports 07
  1. Under Field name, choose DocProperty.
  2. Under Property, choose dradis.client
Reports 08

And the new document property will be inserted in the current position. If you click over it, you'll see a darker background indicating this isn't normal text, but a document property:

Reports 09

Finally, we repeat the process for the other properties

  • dradis.project
  • dradis.author
  • dradis.email
Reports 10

If the field is flagged as a spelling error with a red wavy line underneath, you're going to run into problems on export. If this happens, just change the Value of the field. For example, change "ClientCompanyName" to "Client Company Name" to avoid this problem.

Adding property values to your Dradis project

All the work on the template side of things is over. Lets move on to Dradis.

Custom document properties are stored in the Report content page of your Dradis project. For more on how to add your document properties to your Project, check out the Report Content page of the Project guide.

Reports 11

Update your fields and properties post-export

Word really enjoys not automatically updating these document properties on export. You'll often see placeholder text displayed until you force it to show the real value with an update field. You have three options to update your properties and fields (including SEQ fields) post-export:

  1. Manually update

    This option doesn't scale well to large reports. But, you can manually update fields by right-clicking on them and selecting Update Field as shown below.

    Reports 144

  2. Select All + Update All

    Open up your exported Word report, then use the following keyboard shortcuts to update all the fields.

    Note: if your document has fields within tables, headers, or footers, this method may not update them.

    1. Press CTRL + A
    2. Press F9

  3. The UpdateAllFields macro

    Alternatively, you can use the following macro to update all the properties and fields in your document at once:

    Sub UpdateAllFields()
     '
     ' Macro to completely update the document
     '
     ' Kudos to Sherief for this one
     '
     ActiveDocument.Fields.Update
    
     For Each sec In ActiveDocument.Sections
        For Each head In sec.Headers
            head.Range.Fields.Update
        Next head
    
        For Each foot In sec.Footers
            foot.Range.Fields.Update
        Next foot
      Next sec
    
      Dim toc As TableOfContents
      For Each toc In ActiveDocument.TablesOfContents
        toc.Update
      Next
    End Sub

InfoSec project delivery 5-day crash course

Learn innovative, actionable techniques and approaches for reducing the overhead that drags down InfoSec project delivery. You’ll learn how to optimize:

  • Scoping
  • Scheduling
  • Project Planning
  • Delivery
  • Intra-team Collaboration
  • Reporting and much more...

Your email is kept private. We don't do the spam thing.