Group: microsoft.public.word.vba.general
From: =?Utf-8?B?Qko=?=
Date: Tuesday, April 08, 2008 12:58 PM
Subject: How to replace with a new template to a document


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.