Macro question

N

Natalie

We have a template that is called "Letterhead.dot". I have a user that would
like to be able to click on a button in the toolbar and have the
letterhead.dot template copy to his existing document. I know I would use a
macro in order to do this, but can someone lead me in the right direction as
to how to create this macro. So far, I've been able to create a macro that
opens the letterhead.dot template into a new document, but then the user has
to copy and paste his document into the letterhead document. Just not exactly
sure how to add a template to an existing document. Is this even possible? He
said someone had created a macro for him before that did this, but I'm
skeptical. Please Help!!!
 
J

Jean-Guy Marcil

Natalie was telling us:
Natalie nous racontait que :
We have a template that is called "Letterhead.dot". I have a user
that would like to be able to click on a button in the toolbar and
have the letterhead.dot template copy to his existing document. I
know I would use a macro in order to do this, but can someone lead me
in the right direction as to how to create this macro. So far, I've
been able to create a macro that opens the letterhead.dot template
into a new document, but then the user has to copy and paste his
document into the letterhead document. Just not exactly sure how to
add a template to an existing document. Is this even possible? He
said someone had created a macro for him before that did this, but
I'm skeptical. Please Help!!!

What do you mean by "have the letterhead.dot template copy to his existing
document"? Copy?

What is the overall purpose (Why does this need to be done)?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
N

Natalie

User is in an executive position and has made this request. Need to make this
happen.
 
J

Jean-Guy Marcil

Natalie was telling us:
Natalie nous racontait que :
User is in an executive position and has made this request. Need to
make this happen.

So, if I piece together your three replies, a user is typing letters from
the Normal.dot template, and then needs to add the content form the
letterhead.dot template, specifically, the header information from the
template into these letters.

Templates are not designed to be "Added" to existing documents. You can
attach a template to a document, but this does not bring the content from
the template into the document, it just makes the AutoText entries, macros,
toolbars, etc available to that document.

Now, what you want to do can be done but before we go down that road, can I
ask a question?

May I ask why this executive isn't typing his letters directly from the
letterhead.dot template. Wouldn't it be easier?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
N

Natalie

To be honest with you, I completely agree with what you said and I made that
happen, as far as opening a new document using the letterhead.dot template,
however, apparently someone had set it up for him before to just "insert" the
header into his document rather than starting from scratch. He doesn't
realize the complexity of making that happen. Is using a template, the wrong
thing to do? Should I just create the letterhead.dot into a letterhead.doc
and insert that file instead?
 
J

Jean-Guy Marcil

Natalie was telling us:
Natalie nous racontait que :
To be honest with you, I completely agree with what you said and I
made that happen, as far as opening a new document using the
letterhead.dot template, however, apparently someone had set it up
for him before to just "insert" the header into his document rather
than starting from scratch. He doesn't realize the complexity of
making that happen. Is using a template, the wrong thing to do?
Should I just create the letterhead.dot into a letterhead.doc and
insert that file instead?

The letter should be initially created from the letterhead template. Period.

If this executive wants to mess about with macros to work with two templates
and a document (Letterhead.dot, Normal.dot and his letter document) then he
should be made aware that this is not the way to work with Word and if he
insists, the results will be unpredictable at best. His content may be
thrown out of whack when the header and other stuff from the template is
inserted in his letter. This would lead to further reformatting and over all
wasting time. Are you in the Civil Service? ;-) LOL

Unless there is a real compelling reason to work like this, this path should
be abandoned.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
G

Greg Maxey

To be honest with you, I completely agree with what you said and I made that
happen, as far as opening a new document using the letterhead.dot template,
however, apparently someone had set it up for him before to just "insert" the
header into his document rather than starting from scratch. He doesn't
realize the complexity of making that happen. Is using a template, the wrong
thing to do? Should I just create the letterhead.dot into a letterhead.doc
and insert that file instead?









- Show quoted text -

JGM, excuse me for barging in here.

Natalie, someone needs to tell the executive that he is being
idiotic. Post his e-mail address here if you want me to take that
on ;-). If he ran his business like he is trying to force you to
manage his correspondence, he would soon be either bankrupt or out of
job.

A template is something you "start" with. He is trying to use it a an
overlay. They were not meant for that. Assuming that the dolt is
starting out all of his documents with Normal.dot you might just store
the letterhead logo and text as an AutoText entry in his Normal.dot
file. Then you could assign a macro like the one below to a toolbar
icon or something. This also assumes that the letter head should only
appear on page 1.

Sub SatisfyIgnorantExex()
Dim oRng As Word.Range
ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True
Set oRng =
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Range
NormalTemplate.AutoTextEntries("LetterHeadLogo").Insert _
Where:=oRng
End Sub

P.S. While the macro would still work using a different name, I think
I would keep it like it is. If he is as thick as your problem
indicates, he will likely be working for you before he ever sees it.

Gook luck.
 
G

Graham Mayor

How did this clown get to be an executive? This is not the way Word works.
You cannot add a template to a document in this manner. You add a document
to a template. Suggest that he takes a course in wordprocessing, or sticks
to doing the executive thing and employs someone who knows what they are
doing to prepare his documents for him - and I mean this as no reflection of
your own abilities.

I suppose the nearest you could manage to save your hair is to create the
letterhead elements as an autotext entry or entries that he can insert into
the document with a macro - or just show him how to use a template properly
:(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

mae

If this guy's whole big deal is wanting to press a button on a toolbar, can't
Natalie just create a button that will open a new doc based on the letterhead
template? The only difference between this and what the guy says he wants is
that he'll click the button first instead of last. And if she presents it as
"see, you can see what the finished product will look like AS you're typing,
instead of possibly having to waste your time editing afterwards."

Seems like that would still let him feel like he's making people do special
stuff for him, and he never has to know that's actually the right way to do
it!

I would not use an image, but the word "Letterhead" or something, so he
knows exactly which button to press. And put it right next to the default
New button.
 

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