Welcome,
How Can We Help You?

Create & Integrate Word Macros

Info

This feature is only available in the unlimited plan.

 

You can also easily "record" a macro yourself or include a code example from us. In order to use the macro functionality, the macro must be included in the letterhead file (.docm). This letterhead must then be uploaded to LAWLIFT in the same way as normal Word files uploaded as letterheads and linked to the corresponding intelligent template. When generating a document, LAWLIFT then uses the .docm file and generates the corresponding text. When you open the docm. file, either the macro is executed automatically or you have to execute it manually, depending on the settings. You can also control the execution via a key combination or a button (the latter must also be programmed).

Step 1: Create a new macro

To create a macro, it is first necessary to start a macro recording. This is done via the "View" tab and the button "Macro" -> "Record macro". The macro must first be named (here: AutoOpen, to ensure that the macro is automatically executed when the Word file is opened). The recording can now be started and immediately stopped again if you want to proceed with a code example from us. Do not stop the recording if you want to carry out the steps to be automated yourself. Once you have completed all the steps, you can end the recording. In this case, continue with step 3. If you want to work with the code example, continue with step 2.
 

Step 2: Insert a macro sample code into the letterhead template

In the second step, the code provided (see separate help article) is inserted into the letterhead template. To do this, copy the code to the clipboard using Copy&Paste. Then go to the tab "View" and click on the button "Macro" -> "Show macro". You select the macro and can now open the Visual Basic editing window in the lower area of the window via the "Edit" button. A code snippet appears there, which was generated by the recording. Now replace this snippet with the code we have provided. Afterwards, you can save the changes by clicking on the save symbol in the upper left corner and close the window.
 
Note: If the code example is labelled "AutoOpen". Word automatically executes the macro the first time the generated Word file is opened.
 

Step 3: Binding the Word macro to the Word file

Background: Word usually saves many settings only locally, i.e. on your computer in the file normal.dotm. However, since macros must also be accessible by the respective user, the macros must be bound to the Word file. 
Information security: It may also be that the internal information security guidelines stipulate that no "external macros" may be used. 
To now bind the created macro to the Word file, first go back to the "Show Macros" window. The created macro and the "organise" button now appear there. The "organise" button opens another window. Here you can determine where the macro will be saved. On the right-hand side, select the macro labelled "New Macros" and copy it to the left-hand area using the button in the middle. Then, on the right-hand side, first, delete the macro from the field and then select the "Close file" button below.
 

Now the macro is linked to the file and no longer (only) stored locally on your computer.

Step 4: Upload letterhead template

Now the letterhead template just needs to be uploaded and linked to the LAWLIFT template.

Was this article helpful?

Can't find what you're looking for?

Our award-winning customer care team is here for you.

Contact Support