|
-
Sep 12th, 2005, 08:13 AM
#1
Thread Starter
Junior Member
Problems setting a new template
Hi all,
We've got a bunch of documents that have a template attached with a path that no longer exists. I'm making a small macro which replaces the non-existing path with a new one, but I've run into some problems.
It seems that if the missing template isn't found, the document defaults to Normal.dot (fair enough). But, I want to pull the path of the missing template out of the document. My code is:
VB Code:
Sub FixTemplate()
Set sCurrentTemplate = ActiveDocument.AttachedTemplate
sCurrentTemplate = LCase(sCurrentTemplate)
sOldTemplate = LCase("\\some_server\share\missing_template.dot")
If sCurrentTemplate = sOldTemplate Then
ActiveDocument.AttachedTemplate = "C:\program files\templates\text97.dot"
End If
End Sub
This would work beautifully, except that ActiveDocument.AttachedTemplate is "Normal.dot" (since the otehr one can't be found). However, in the Templates and Add-Ins dialog, the path to the missing template is available.
Since the path is still there, I figure there's gotta be some way to pull it out, but damned if I can find it. Any hints?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|