Automated Document Revision Information Reference


On the cover of the documents I produce I like to put the print date and a version number.

frontpagerev

But sometimes… I forget to update the version number, even though I’ve updated the Document Revision Information on the inside pages:

docrevinfo

So, I went looking for a solution that would automatically update the front cover every time I added a new version number in the Document Revision Information table.

After several attempt using the { =MAX(Above) } field in the Document Revision Information table (which didn’t work well because it had to be placed in the last row of the table using hidden text if you didn’t want it printed) I figured out that I could apply the MAX function to a Bookmark reference, and that if the table was bookmarked, I could reference the Rows and Columns in the table.

Here’s the steps I took.

Step 1: Bookmark the table.

Select the table, and choose Insert | Bookmark, name the bookmark and click Add.  I called my Bookmark DocRevisionInfoTable (MS doesn’t allow spaces in Bookmark names).

addbookmark

Step 2: Formula reference to DocRevisionInfoTable

Now go to the front cover where you need the latest version number calculated, and:

  1. Press <Ctrl+F9> (Windows) or <Cmd+F9> (Mac OS X) to insert a field code.  This will make a stylised pair of braces appear – {} with the cursor between the braces.
  2. Enter the following text between the braces

{ =MAX(DocRevisionInfoTable A:A) \#"#.0#" }

fieldformula

  1. Press <F9> to update the field

fieldupdated

A little explanation:

The field { =MAX(DocRevisionInfoTable A:A) \#”#.0#” } works like this:

DocRevisionInfoTable is of course the name of the table.

A:A defines the first row of the table.  According to this document, I should have been able to use C1 to define the first column, but that didn’t work for me.

\#”#.0#” is a format descriptor.
The \# says “this is a number format”
The “#.0#” says “print all digits before the decimal point, and at least one place after the decimal point”.  This means that version 2.0  will print as 2.0 rather than just plain old 2, and if there is a version 2.01 the extra digit after the 0 gets printed too.

RedNectar

 

 

About RedNectar Chris Welsh

Professional IT Instructor. All things TCP/IP, Cisco or Data Centre
This entry was posted in Microsoft Word, MS Word Tips and tagged , , , , , , , , , , , , . Bookmark the permalink.