Attached Template

S

Stephen English

We have just upgraded from using Word 2000 running under Winwows 2000 to using Word XP running under Windows XP

I have a document that says it has a template of Manifest5SIS.dot and yet when I run the code below, it is telling me that the Attached template is Normal.dot. It worked fine in 2000

This code is stored in a startup template and run from a toolbar button
Any ideas please?
Stephen

On Error GoTo EXITSUB
Dim strMsg As String

With ActiveDocument
If .AttachedTemplate = "Manifest5SIS.dot" Then
.AttachedTemplate = _
"C:\Program Files\Microsoft Office\Templates\COS - General\Manifest5.dot"
ElseIf .AttachedTemplate = "Manifest4a.dot" Then
.AttachedTemplate = _
"C:\Program Files\Microsoft Office\Templates\COS - General\Manifest5.dot"
End If
If .AttachedTemplate = "Manifest5.dot" Then
'Debug.Print CDate(Application.Run("ReadProp", "ReviewDate"))
If CDate(Application.Run("ReadProp", "ReviewDate")) <= Now() Then
MsgBox "Click ShowDocProperties to change review date", vbOKOnly, "Check Review Date"
End If
End If
End With
Exit Sub
EXITSUB:
MsgBox "Error", vbOKOnly, "Sorry, I can't complete this task for you"
End Sub
 
J

Jonathan West

Hi Stephen,

1. Are you sure you have the macifest templates on your new mchine?

2. Are you sure that they are located where the macro is expecting them?

When you open a document in Word, if its template is not available, then
normal.dot is attached instead.

--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup


Stephen English said:
We have just upgraded from using Word 2000 running under Winwows 2000 to
using Word XP running under Windows XP
I have a document that says it has a template of Manifest5SIS.dot and yet
when I run the code below, it is telling me that the Attached template is
Normal.dot. It worked fine in 2000
 
S

Stephen English

Hi Jonatha
Thank you for your input
I am 99% certain this worked last year but on checking it wouldn't work on any version now
I solved the problem by using the builtin document property Template instead of Attachedtemplate
Thank you for your suggestions
Regard
Stephen English
 

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