|
|
|
date: Sat, 16 Aug 2008 07:15:14 -0700 (PDT),
group: microsoft.public.word.vba.general
back
Re: Transfer a template
It is fairly straightforward to attach a template with vba
With ActiveDocument
.UpdateStylesOnOpen = True
.AttachedTemplate = "D:\Word Templates\Templatename.dot"
End With
however if the style names in the document don't match the stylenames in the
template it will not achieve anything useful.
If you wish to replace stylenames in a document with stylenames in a
different template, then you will have to know in advance which stylenames
will be replaced with which.
You can also copy styles from one document to another eg
Application.OrganizerCopy Source:="D:\Word Templates\Sample Style.dot",
_
Destination:="D:\My Documents\Test\Versions\Even\sample.doc", name:=
_
"Body Text", Object:=wdOrganizerObjectStyles
but unless the document you copy to has text formatted in those styles
nothing will change.
What you cannot do is automatically reformat a document to match another
document when the formatting styles are different in each.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
tony wrote:
> On Aug 16, 7:40 am, "Graham Mayor" wrote:
>> Assuming you have used the same style names etc., attach the document
>> template to the other documents.
>
>
> Thank you, Graham.
> I created a.dot from the model document a.doc, but I'm not clear about
> attaching a.dot to b.doc
> Moreover, judging by the fact that fonts and other features of b.doc
> are different from those of a.doc
> (even though the outline/layout of the two is the same), I cannot
> assume the same styles in both.
> With this in mind, how can I determine the styles of various portions
> of a.doc and transfer them to b.doc?
>
> T.
date: Sun, 17 Aug 2008 09:50:13 +0300
author: Graham Mayor
|
|