- Word documents have Word document properties. These are perfectly suited to being used as placeholders for variable content at various points in the document and are therefore very important in technical documentation.
- For example, a version number can appear identically on the cover page, in the footer and in various other places in the document and only needs to be entered once.
- We have developed a tool with which document properties can be created and filled with content very easily and conveniently via an input mask in documents.
Instructions for the document properties tool
- The tool for centralised maintenance of document properties in Word consists of two components that are coordinated with each other:
- the actual programme file
- a configuration or data table file in MS Excel format.
- This description explains how you can adapt both the user interface of the dialogue window and the output, i.e. individual document properties, to your requirements simply by changing the configuration file. This means that nothing needs to be changed in the tool itself; it is sufficient to customise the Excel file.
- We will also show you how to integrate the tool into Word for use.
Where to put it: the filing path
- After unpacking the ZIP archive downloaded from us, please copy the files to the correct location. The ZIP archive already contains the Tool folder mentioned below with its subfolder config. You can therefore unpack the entire ZIP to C:\Program Files (x86)\dokay. The following conditions must then be present:
- The Word macro file dokumenteigenschaften.dotm must be located in the folder C:\Program Files (x86)\dokay\Tool. You can change the name of the file if required.
- The Excel file must be in the config subfolder. Its name must remain unchanged.
- Below you will find step-by-step instructions on how to configure the tool. To do this, open the Excel file in the config subfolder, either directly in Excel or by clicking on the Konfiguration button.
Step 1: Customising the tabs
- There are a total of three tabs in the input screen. By default, two of these are set visible and one is set invisible.
- The labelling of the tabs and their visibility is set up in the Konfiguration_Register table:
- The desired name of the register is entered in the Caption column.
- The Visible column contains a 1 if the tab is to be visible or a 0 if it is to be hidden.
Schritt 1: Anpassung der Register
- In der Eingabemaske gibt es insgesamt drei Register. Davon sind im Auslieferungszustand zwei sichtbar und eines unsichtbar.
- Die Beschriftung der Register und ihre Sichtbarkeit wird in der Tabelle Konfiguration_Register eingerichtet:
- In der Spalte Caption wird der gewünschte Name des Registers eingetragen.
- In der Spalte Visible steht eine 1, wenn das Register sichtbar sein soll, oder eine 0, wenn es ausgeblendet sein soll.
Step 2: Define and name the elements on the tabs
- On each of the three prepared tabs, 10 text input fields and 10 combo boxes are arranged so that they cover each other 100%.
- By selecting the appropriate elements in the Configuration_Fields table for each of the 10 positions, you can control whether either a text input field (Visible = 1 for TextBox no. x) or a selection field (Visible = 1 for ComboBox no. x) or nothing (both 0) appears.
- By default, a text input field and a selection field are always active alternately.
Schritt 2: Die Elemente auf den Registern festlegen und benennen
- Auf den drei vorbereiteten Registern sind jeweils 10 Texteingabefelder und 10 Comboboxen so angeordnet, dass sie einander zu 100% überdecken.
- So kann durch die entsprechende Auswahl der Elemente in der Tabelle Konfiguration_Felder für jede der 10 Positionen gesteuert werden, ob entweder ein Texteingabefeld (Visible = 1 bei Textbox Nr. x) oder ein Auswahlfeld (Visible = 1 bei ComboBox Nr. x) oder nichts (beide 0) erscheint.
- Im Auslieferungszustand ist immer abwechselnd ein Texteingabe- und ein Auswahlfeld aktiv.
Step 3: Configuring the selection fields
- The input mask contains a total of 30 selection fields (ComboBoxes), 10 on tabs 1 to 3.
The ComboBoxes have the following reference to Excel:
-
- Their names and visibility are set in the Konfiguration_Felder table in the left-hand area.
The source for the selection lists for each combo box are the tables to the right of the Explanations table (from position five), in their order from left to right, regardless of their name! By default, these tables are all named Quelle_ComboN (with N from 1 to 30).
- Their names and visibility are set in the Konfiguration_Felder table in the left-hand area.
- So: ComboBox 1 reads from the first table from the left, ComboBox 2 from the second and so on. The Excel file contains 30 tables for the 30 combo boxes created.
Tables for the selection fields
- The tables have the structure shown:
At least columns A to C must be present. Additional columns can be inserted to the right of column C, the contents of which then appear from line 7 onwards next to the entries in column C in the expanded selection list.
Meanings:
- Reihenfolge Anzeige: sets the sequence of the display from the lower Daten area, numbered in ascending order from left to right.
This is only relevant if there is more than one column in the table. - Breite Anzeige in “Point”: Sets the width of the column display in the expanded list of the selection field.
- Dokumenteigenschaft: Names the document property in which the macro saves the selected values when exiting with OK.
- Titel: This field only has a labelling function for the data noted below it.
- Datenbereich: From cell C7 this area contains the selection data. Further rows can be added without any problems. They should only contain content formatted as text.
Tabellen zu den Auswahlfeldern
- Die Tabellen haben den abgebildeten Aufbau:
Es müssen mindestens die Spalten A bis C vorhanden sein. Es können weitere Spalten rechts von Spalte C eingefügt werden, deren Inhalt ab Zeile 7 dann neben den Einträgen in Spalte C in der aufgeklappten Auswahlliste erscheint.
Bedeutungen:
- Reihenfolge Anzeige: setzt von links nach rechts aufsteigend nummeriert die Reihenfolge der Anzeige aus dem unteren Bereich Daten. Dies hat erst dann Bedeutung, wenn mehr als eine Spalte in der Tabelle vorhanden sind.
- Breite Anzeige in “Point”: Setzt die Breite der Anzeige der Spalten in der aufgeklappten Liste des Auswahlfelds.
- Dokumenteigenschaft: Benennt die Dokumenteigenschaft, in welcher das Makro beim Beenden mit OK die ausgewählten Werte abspeichert.
- Titel: dieses Feld hat nur Beschriftungsfunktion für die darunter notierten Daten.
- Datenbereich: Ab Zelle C7 stehen die Auswahldaten. Weitere Zeilen können problemlos hinzugefügt werden. Sie sollten nur als Text formatierten Inhalt enthalten.
Step 4: Configuring the text input fields
- The input screen contains a total of 30 text input fields (“TextBox”), 10 each on tabs 1 to 3.
- The TextBoxes are in the right-hand block of the Konfiguration_Felder table in the Excel file.
- Enter the name of the text input field in the Label.Caption column.
- In the Visible column, set the visibility of the field in the screen (1 or 0)
- The DocumentProperty column contains the document properties to be entered in the respective field (see below). You can name these as you wish or taking into account names that have already been assigned.
Step 5: Assigning the document properties
- The purpose of the tool is to assign document properties with the values entered or selected in the input mask.
- If the document properties already exist in the Word document, the values are assigned to them. If not, the tool creates them in one go and assigns the values to them.
Integrating the tool in Word
- The steps at a glance:
- Show developer tools tab
- Load tool as add-in
- Integrate the start routine into the quick launch bar
- You can see the details in the short video tutorial.