The Birth of a Logos and Word Template Automation Tool

Pieter J.
Pieter J. Member Posts: 533
edited November 21 in English Forum

OS         : Win 10

Lang       : VBA
Files       : Normal.dotm and 2 x Template Samples
Location  : C:\Users\YourUserName\AppData\Roaming\Microsoft\Templates
Purpose  : Automate Word Templates to receive Logos Exports for any kind of Panel.

What will happen?
When you print from any panel in any layout you created a unique template for, Word will open the correct template automatically to receive the export from Logos. You can extend the code to save automatically if needed.

How does it work?
Template FileNames are a combination of Logos Bible Software's Main Window Title and the Kind of Panel you are printing from. Word is triggered when a Print/Export window is activated in Logos. This way you can trigger different template designs using Logos Layouts and Panels.
 
Create a Word Template. Use the complete Caption of Logos Bible Software's main window and the Panel Kind that should trigger the template.

If you have no layout open and the template should be used for a Sermon Document, the Templates name should be:

Logos Bible Software.Sermon.dotx

If you have a layout open with the title "Test" and the template should be used for a Sermon Document, the Templates name should be:

Logos Bible Software - Test.Sermon.dotx

Save Your Templates in the C:\Users\YourUserName\AppData\Roaming\Microsoft\Templates folder. (You can change the location in VBA inside the ClassLogos class module)

With Logos already open, when you want to print to a Template, just open Word. Keep it open for more print/export jobs. In Logos open the layout and Document you created a Template for and continue to Export as normal to a open Word document. As long as Word stays open it will automatically open the correct template for corresponding exports.

You will notice that when the Print/Export Panel is opened in Logos the corresponding Template in Word will be opened to receive the export.

Just Save the Word Document or Export to PDF or any other format needed. (Customize code to do this automatically.)

You can discover Panel Kinds in the Visual Basic for Applications Immediate window. When you Activate a Panel in Logos the Template Name you should use are printed in the Debug (Immediate) Window.

Please notify me of bugs or any improvements if you use this template. I hope this could be useful to other Logos users. I used this method for two years now and decided to create this VBA version in Word and share it.

8231.Normal.zip

6180.Templates.zip

Tagged:

Comments

  • Eugene Nowak
    Eugene Nowak Member Posts: 90

    I placed the supplied Normal template with the embedded VBA in the template folder.  Next place the supplied Logos templates in the template folder.

    1st issue - Missing the library reference resource in the Normal template to run the VBA:

    It doesn't know where to find the dll/exe necessary to perform the requested function.

    I had to go to C:\Users\eugen\AppData\Local\Logos\System\ and point the reference library to LogosCom.exe to register the reference in the library.  That removed the error message.

    2nd issue - I next named a layout Test and opened a Sermon panel.  Selected print/export into a new Word document.  The print result did not bring up the supplied template.

    Tried it with no title to the Layout and a Sermon panel open.  The result did not print to the other supplied template.

    Made sure all Debug.Print code lines had a prefix string for identification.  Ran againg with no name layout and a sermon panel and got "Err.Number 0" in the Immediate window.  Did not open a template with the sermon inserted into it.  Just opened Word with the sermon like it always did.

    Please advise.

    .

  • Pieter J.
    Pieter J. Member Posts: 533

    1st issue - Missing the library reference resource in the Normal template to run the VBA:

    Thanks for pointing this out I'll try to improve the code to avoid this manual step.

    2nd issue - I next named a layout Test and opened a Sermon panel.  Selected print/export into a new Word document.  The print result did not bring up the supplied template.

    Could you please make sure that this is the case. If Logos is Maximized you won't always see the Template because it is in the background.

  • Simon’s Brother
    Simon’s Brother Member Posts: 6,816 ✭✭✭

    I’ll try this out on the weekend PJ.

    Many years ago I created one of these for Word and Libronix (Libby) while another user, Dale Durnell created one for WordPerfect. I first came across Dale when he was creating something similar for QuickVerse and WordPerfect. Times have changed so good to see someone take up the challenge and create something for today.