Using Letterhead Template Via Code

Q: I have a large Word app that I built a long time ago for a client. Now they are using a new PDF system and the letterhead graphic is now to be handled in Word instead of in the PDF driver. What I mean there is that the company letterhead, which goes down the side and across the top, is to be applied in Word and layered over the letter which the app creates. The letterhead is not to be used all the time, so I have to be able to basically turn that on or off. The client has given me a template with the letterhead graphic embedded into the header/footer layer. My app is also a template and is loaded into the Office/Startup area with other templates. I would like to have my app create the letter as it has always done, but use the template they gave me to attach their letterhead. This would be the least painful thing to do I believe. It would probably be easier to have the graphic on the header/footer layer of my own app, but I've put the graphic there and when the letter is created, the letterhead graphic is nowhere to be seen. This is the one big Word app I've ever built. I'm usually an Excel and Access guy, but this app is substantial and is userform driven. There is tons of code already invested so I really need to make this letterhead piece work. I've studied the code but I cant figure it out. I'm hoping you can help me. There is a piece of code where it says document.add Template:="", NewTemplate:=false I may not have quoted that snippet exactly but I'm sure you know the method. I've tried changing the "" and putting my letterhead template path and name inside the double quotes, but that does not result in the letterhead showing up either. I'm stumped. Lets assume for now that both the main app and the letterhead template (which both have .dot extensions) are on the desktop.

A: -See http://addbalance.com/word/templatesmenu.htm. strPath = "C:\Documents and Settings\All Users\Documents\Shared Templates\" strName = "letterhead.dot" Documents.Add Template:= strPath & strName, _ NewTemplate:=False, _ DocumentType:=wdDocument, _ Visible:=True -Take a look at: How to set up letterhead or some other document where you want one header on the first page and a different header on other pages. http://www.addbalance.com/word/headersfooters.htm This gives step-by-step instructions. (It also has the following links) Some other pages to look at: Letterhead Tips and Instructions http://home.earthlink.net/~wordfaqs/Letterhead.htm Letterhead Textboxes and Styles tutorial http://addbalance.com/word/download.htm#LetterheadTextboxesAndStylesT... Template Basics http://www.addbalance.com/usersguide/templates.htm How to Create a Template - Part 2 - essential reading http://www.mvps.org/word/FAQs/Customization/CreateATemplatePart2.htm Word "Forms" http://www.addbalance.com/word/wordwebresources.htm#Forms and Word for Word Perfect Users http://www.addbalance.com/word/wordperfect.htm if you are coming from a WP environment (or even if you are not). If you are interested in creating templates that will work with the letter wizard or use that wizard, you should look at the chapter on Advanced Document Formatting in Using Office 2003 (or whatever your version is), Special Edition, by Ed Bott and Woody Leonhard.

It has detailed instructions including instructions on getting the fields you want from your Outlook Contacts for addressing a letter. (Chapter 19 of SE Using Office 2003) You should be able to get this through your public library or at Amazon.com http://www.amazon.com/exec/obidos/ISBN=0789729555/balancecheckbookA/ Finally, take a look at the letter templates that come with Word. While they are no great shakes as letterhead, they do use styles and AutoText lists very well. If you use the same style names that are used in those templates in your own letterhead for the same parts of the document, you will have better luck with using the built-in AutoText entries in Word.