How to let user know where to the attached Template is missing

B

BJ

user created a document using a template called test.dot which is located at
his office PC's C:\Program Files folder.

user brings this document home and wantes to keep working on it, but his
home pc doesn't have this test.dot saved under his home pc's C:\Program
Folders. How can let user know that he doesn't have the template and he needs
to copy that to his home pc for keeping working on this document.

Thank you,
 
B

BJ

I just want to make my prior questions a little bit clear.

this template is used by the whole company not only one user. so it's not
like i can tell this user what to do.

they want to have a message remind them that they need to bring the template
home for working on the document once they click on the doc instead of
wondering why they didn't see all the tools they suppose to see. are there
any ways that can let user know that. is that possible?
 
G

Graham Mayor

You could add an autoopen macro to the document to attach the template in
question which will produce an error if it is not available

Sub AutoOpen
On Error GoTo ErrorHandler
ActiveDocument.AttachedTemplate = "C:\Program Files\Test.dot"
Exit Sub
ErrorHandler:
If Err.Number = 5180 Then
MsgBox "The document template is not available on this PC"
End If
End Sub

but there is no guarantee that the user will allow macros in documents to
run
A bit of user training might be more appropriate.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

BJ

do you mean I need to show the users how to add the 'AutoOpen' macro to their
documents that they created using the template? can i distribute this macro
from the template? once the user opened the doc which has the template
attached to it, then 'copy' this code to the document?
 
G

Graham Mayor

No, I meant the users need training to take home a copy of the template. I
also assumed that it was just one document and that could contain the macro,
albeit the user may not allow it to run. There is no real solution to this
other than the users having copies of the templates they wish to work with.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

BJ

under the Templates and Add-ins, the template name under 'Document template'
still contains the original template path, for example, "C:\Program
Files\Test.dot' even the template is not there.

are there any way i can get this using VBA?

I plan to put AutoOpen code under 'Normal' and to check the template name in
there, but don't want to show the not existing message to any other work docs
that are not using this template.

Thank you very much for your help.
 

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