BJ
Wed Apr 09 06:51:00 PDT 2008
The template is not protected. the template is used by all the departments.
user first download it from our intranet, and the template will be saved to a
common folder on their C drive. but somehow some users copied the template to
their favoite folder. So once we updated the template and notified user to
download the updated one, their templates didn't get updated since they saved
to somewhere else.
I tried to add some code to attache the correct template and received the
error message.
"Graham Mayor" wrote:
> As the error message indicates, if the template you are trying to attach is
> a locked form template, the function will fail. Wouldn't it be simpler to
> create new documents from the template?
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site
http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> BJ wrote:
> > Here is my code:
> >
> > Set thisDoc = Application.ActiveDocument
> > Set myTemp = thisDoc.AttachedTemplate
> >
> > If myTemp.Path <> "C:\MyWordTemplate" Then
> > With thisDoc
> > .AttachedTemplate = "C:\MyWordTemplate\TestTemplate.dot"
> > .Save
> > End With
> > End If
> >
> > I received the following message:
> >
> > Word cannot attach a document to a protected template.
> >
> > Thank you for any help.
>
>
>