-
The template has each letter structure IN the document, with each one bookmarked. On Document_New (fired when the user invokes the template), a userform displays with the choices.
The user selects "Cost Recovery Letter" and clicks OK.
The userform closes and deletes the bookmarks (and therefore the content) of the other letter structures.
What are they left with? A new Cost Recovery Letter document.
If they chose Training Cost Request Letter, then the others are deleted, and what are they left with? A new Training Cost Request Letter.
The power of bookmarks. The power of templates. It is all a matter of design.
I have one template that handles nine different (but similar) letters. A very good reason for having them in one template. Each of the nine share about 60% of user input data.
So no matter which of the nine choices they select, they get the same input userform to get that data. That way I only have to build ONE userform - rather than nine separate "template" files, and nine different userforms. Although yes, you can copy userforms between files...but why bother????
Then, depending on what their choice was, a stream of logic specific to that choice runs.
This may require another userform, or it may not. It depends on the requirements of their chosen letter.
The point being is that all of this is in ONE .DOT file. Yes, I admit building them takes serious design considerations, and a bit of work. However, once this is done, changes only have to be done in ONE file.
For example. We changed a graphic that was in the header. Badda-bing, badda boom. I open that ONE file, change the graphic. Done. All those nine different letters will be produced with the new graphic, as they all come from the same template file.
PLUS, I keep the template files on a user restricted network folder, so they can not mess around with them. They can USE them, but that is it. PLUS, I can run very easy code to change ALL of my template files in one operation. I can change the graphic (or whatever) in ALL my templates in a twinkling.
For "localized" templates used only in our national headquarters (not in the field), I actually do not put graphics in the template. The template New code uses WinHTTP to grab a graphic from a web server on our Intranet, and puts it into the header.
When the template makes a new document it actually retrieves the graphic dynamically from a web server, using WinHTTP. That way, the graphic for ALL files comes from ONE location, and is always the latest one.
NOTE: the same code is also in Document_Open, so each time the document is opened it always grabs the latest image. Change the graphic, no need to ever update any documents. They always use the latest image.
This obviously is not the route for everyone. We have T3 connections within our headquarters. And I only use this for document I know are ONLY being used there. Field documents do not use this. We have T1 connections most places, but nevertheless with 30,000 users scattered over 5,000 points of services across 6 time zones.....our network guys would not approve.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules