Adding a letterhead

G

Gal Zilberman

Hi All
I've recorded a macro in which I add a letterhead from a template
(RunLetterWizard,CreateLetterContent), which works fine other then one
problem.
It will set all the parameters correctly and will open the Letter Wizard,
but then it won't complete the action, it waits for me to click OK
Is there a way to avoid this (without SendKeys)?

Gal
 
C

Charles Kenyon

Why not use the letter wizard to create a letterhead template and use that
as the basis for your documents? By manually creating and modifying a
template you can get a superior result.

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.zebra.net/~sbarnhill/Letterhead.htm

Letterhead Textboxes and Styles tutorial
http://addbalance.com/word/download/index.htm#LetterheadTextboxesAndStylesTutorial

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.

Hope this helps,
 
G

Gal Zilberman

Hi Charles
Thank you for your response, but I still need the code.
I already have a company letterhead which everyone is using, but I'm
exporting a word file from an Access report and I need to add the template
to it.

regards

Gal
 
C

Charles Kenyon

"Adding a template" obviously has some meaning to you that doesn't come
across to me. Once a document is created, attaching a template to it doesn't
change the text or layout. It can change the styles. Creating a document
based on a template gives you any text and layout in the template. Can your
Access report create a new word document based upon a particular template?
If so, you want a preset template rather than the wizard.
 
G

Gal Zilberman

Hi Charles
Unfortunately, Access only outputs a simple RTF file, without the ability to
use a template.
What I'm trying to do is just to add the company's header (Logo + Address)
to the document using VBA.
At the moment I've managed to do that by recording a macro where I use the
Letter Wizard, but here is my problem, when the macro is used, it will open
the Letter Wizard with all the correct data in it, but then I have to press
OK manually, that is the problem.
I hope this is clearer, forgive me English is not my mother tongue

with thanks

Gal
 
C

Charles Kenyon

Hi Gal,

Don't use the letter wizard. That has got to be the hard way. Either put
your letterhead components into AutoText entries and insert them using vba
(into headers/footers) or put the components in a separate document or
template with bookmarks and insert them into your new document. Or, generate
a new document from a letterhead template and insert the contents of your
..rtf file. (This last method is the simplest if you can do it.) You would
then close and discard the .rtf file and use the new document. This uses the
Documents.Add method.
 
G

Gal Zilberman

Very nice indeed!
I used the Open a new doc from template and paste the text into it method.
Thank you for the advice, it's works so much better now.

Gal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top