Re: using letterhead automatically
- From: "Doug Robbins - Word MVP" <dkr@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Jul 2007 14:55:02 +1000
You should set up as many templates as you need, the way that you want them
(that is with headers, with different first page header, without hearders,
etc. etc..)
Then in your userform you provide a means for the user to select the
appropriate template and then use the command
Documents.Add("template") to create a document for the rest of the code in
your user from the act upon.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
"R. Choate" <rchoatecpa@xxxxxxxxxx> wrote in message
news:%23fxpp58xHHA.5276@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
Thank you for your advice. In my situation it is a bit late for me to
change course. Additionally, my application generates several
different types of letters for which a single template setup would not
have served each need, thus the code-driven
instructions/changes. I do currently have, as you recommended, one
template with the letterhead and one without. I just need to
understand how to make the one without the ltrhead call on the one with it
(via code), and apply that letterhead to just the 1st
page (assuming the user has selected to use ltrhead and that there will be
more than one page). By the way, it is not known until
the letter generation is complete whether there will be more than 1 page.
I have already handled the part about dealing with the
user specifying if they want to use ltrhead.
Seems like my biggest problem was the ltrhead was messing up my 2nd page
headers and footers that are created via code. The
headers/footers are really very simple and use a small header space for
the header (2 or 3 lines at most), but I recall that the
ltrhead template was changing the size of my header and making it very
large, perhaps trying to put the entire ltrhead in the
header. What is the best way to call on that ltrhead template from the
other one?
Thanks !
Richard
--
RMC,CPA
"Doug Robbins - Word MVP" <dkr@xxxxxxxxxxxxxxxxxx> wrote in message
news:eHN9G%232xHHA.4476@xxxxxxxxxxxxxxxxxxxxxxx
I would have a couple of templates, one with the letterhead and one
without
and then the code would use the appropriate one based on whether the user
had checked the check box or not.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
"R. Choate" <rchoatecpa@xxxxxxxxxx> wrote in message
news:e8Ax$P2xHHA.4392@xxxxxxxxxxxxxxxxxxxxxxx
Thanks for your advice, Shauna. I will look over all of this very
carefully as I play with this whole letterhead dilemma again. Not
every letter "wants" the letterhead applied to it. That is determined my
a
user decision that is indicated by checking a checkbox on
the userform. I thought I had gone over this whole auto-text subject
before, but I did not know about the paragraph marker thing. I
do know that I was getting all kinds of problems. Everything from having
my real headers and footers messed up by the letterhead to
having the letterhead show up again if there was a 3rd page and so on. I
know that sounds like somebody told it to do an odd pages
only setting, but I don't think that happened. I just know that by having
the letterhead in the same file as the template I was
using to generate the letters, things went badly. I guess the file itself
has styles and settings which the letters it generates
inherit, but I am also giving lots of specific instructions regarding
headers and footers, margins, fonts, you name it, via code. I
hope I get all of this sorted out quickly.
Thanks again !
Richard
--
RMC,CPA
"Shauna Kelly" <ShaunaKelly@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uVPFAwzxHHA.4300@xxxxxxxxxxxxxxxxxxxxxxx
Hi Richard
Some comments that might help. Here I've used the word "letterhead" to
mean
the combination of images and/or text that you want to appear on the
first
page of a letter.
1. When you create an AutoText, if you include the end-of-paragraph
marker
in the AutoText, then Word will respect all the styles or direct
formatting
you have applied to the content you're saving as an AutoText. That would
be
appropriate for the letterhead. And, when you insert such an AutoText,
set
the RichText argument to True.
2. When you create an AutoText, if you don't include the end-of-paragraph
marker, Word stores only the text. That is appropriate for inserting
unformatted text into the middle of your document--perhaps into the
middle
of a paragraph. The text will taken on the style and direct formatting of
the text around it. Generally, you set RichText to False in this case.
3. The source of your letterhead (ie whether typed by hand, or copied and
pasted, or generated by doing File > New and choosing a template that has
the letterhead in its header) is completely unrelated to whether or not
that
letterhead appears in the header of the first or odd or even pages. That
depends on the properties of the first Section in the document. You'll
need
to set the Section properties so that .DifferentFirstPageHeaderFooter is
true. VBA Help provides examples.
For more information on what to do, see
Working with sections
http://www.word.mvps.org/FAQs/Formatting/WorkWithSections.htm
and
Setting up letter templates
http://sbarnhill.mvps.org/WordFAQs/Letterhead.htm
For how to find out what objects and properties to use see
http://word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
"R. Choate" <rchoatecpa@xxxxxxxxxx> wrote in message
news:%23igoZgyxHHA.4928@xxxxxxxxxxxxxxxxxxxxxxx
Thanks. I'll look into it and hopefully be able to use that type of
solution and still have the letterhead only show up on the first
page. The letterhead is not text, per se. It is graphics. Although it is
mostly text, it goes not only across the top but down the
left side as well. I'll see what the good ol Word VBA help has to say.
Richard
--
RMC,CPA
"Russ" <drsN0SPAMmikle@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C2C0091E.1B2FE%drsN0SPAMmikle@xxxxxxxxxxxxxxxxxxxxxxxx
You can recreate your letterhead(s) and store it(them) in autotext in
your
template, then later with vba code insert which one you need where you
want.
Look up autotext in Word VBA help for examples.
I am clearly not articulating my situation well and I apologize for
that.
I
don't wish to waste anyone's time. My primary file is a
Word template which houses a few userforms and about 20 modules. The
file
accepts some user entry and connects via ADO to an Access
db to extract some more needed data (to save the user a ton of time),
and
then
it connects to Goldmine db for contact info so the
user doesn't have to type in all of that stuff. Since it is a public
accounting letter to clients, it almost always continues on to
ultimately create a pdf file, and in many cases the code creates a new
message and attaches the new Word letter to it and then
remains open for the user to type in the email verbiage. All in all, it
is a
very large and comprehensive template. I think it took
me from six to nine months to build it back in Y2K with a little
inherited
code and the rest all new. Anyway, as you can see, I'm
already using a template to create the primary result, the letter
itself.
I
have the letterhead in a separate template file.
Sure, I can type a letter just using the letterhead template file and
tell it
I want different 1st page, but that would not take
advantage of all of the features provided by the other, more elaborate
(and
more important) template which write the letter in the
first place. The main letter template creates hundreds or even
thousands
of
possible combinations of sentences and they are
contextual in their construction. The user gives the template enough
info
in
the userform for the code to go forward and type the
letter. I have got to have a wedding between the letterhead template
and
the
letter creation template. This is not "re-inventing the
wheel". I simply already have a template which I must use and I need
the
letter generated by that template's code to be typed on the
letterhead which is supplied by the other template file. Please help me
to
accomplish that if you can think of some code or leads to
code which will allow me to accomplish this all without user
intervention.
Thank you very kindly for suffering through my longer explanation.
Richard
--
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
.
- References:
- using letterhead automatically
- From: R. Choate
- Re: using letterhead automatically
- From: R. Choate
- Re: using letterhead automatically
- From: Graham Mayor
- Re: using letterhead automatically
- From: R. Choate
- Re: using letterhead automatically
- From: Russ
- Re: using letterhead automatically
- From: R. Choate
- Re: using letterhead automatically
- From: Shauna Kelly
- Re: using letterhead automatically
- From: R. Choate
- Re: using letterhead automatically
- From: Doug Robbins - Word MVP
- Re: using letterhead automatically
- From: R. Choate
- using letterhead automatically
- Prev by Date: Re: Missing Field in Merge
- Next by Date: Re: VBA code to search for FileName in Word
- Previous by thread: Re: using letterhead automatically
- Next by thread: Re: using letterhead automatically
- Index(es):
Relevant Pages
|
Loading