Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Sharing templates on the network
OK, I've read up on best practices for sharing Word templates over the
network, and I'm rather disappointed at the hoops you have to jump through. It's hard to believe that in order to be able to update a template on the network you either need to insist on users maintaining their own local copies of the templates, or you need to have everyone close every document that could be based upon these templates. IMHO that's bogus. Yes, I know that you can automatically update users' private template copies with login scripts and such, but that's still bogus. Whatever. If there's some way now to prevent templates from being locked, then please let me know. Assuming not, I have a few other questions. 1) I'm baffled by the file locking in the first place. If I rename the template on the network that a document is based upon, the document still seems to open just fine. What am I missing? If it's just not having the capability of storing style changes in the template unless it can be located, then that's fine, because I wouldn't want people changing these shared templates anyway. 2) People have already created several documents based upon templates located on network drives. If we want to prevent these documents from locking the templates on the network in the future, do we now need to update all of these documents to point to a local version of the template? If so, could someone please provide me with the steps for doing this? I *think* I have a general idea how this would be done, but I don't want to screw it up. 3) I've read about the techniques for copying templates locally using login scripts. These are tightly controlled by our IS department, and I'm not sure they would make group-specific changes for stuff like this. Besides, some people just lock their desktops and don't logoff for days or even weeks. I'm kind of liking a scheme involving a simple front end batch scripts that copy templates locally and then open MS Word using the new templates (e.g., perhaps one script per template). Does anyone see any issues with this scheme? 4) So what is to prevent someone from using the templates directly from the network drive as they're doing now? Note also that we need to have the templates stored on a network drive, and document authors also need write access to the drive. That's because we maintain our document templates with Visual SourceSafe, and the network drive provides a location for VSS to shadow template changes. People besides myself might be making changes to the template, so we all need write access to the shadow location. I make this point because we can't just change access to the network drive to read-only in an attempt to work around this problem. (And I'm not sure that that would prevent the templates from being locked anyway.) |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Sharing templates on the network
I ended up writing a script (question #3) that I *think* does the
trick. Figured I'd post it here in case anyone else found it useful, or if anyone had any suggestions to it. If anyone has any insights on my other questions as well, I'd be much obliged. Thanks. (The script wraps a little from the news group formatting, but you get the idea.) begin script ' Name: CreateNewDocument.vbs ' ' Description: ' ' This script does the following: ' ' 1) Prompts the user for an MS Word (.dot) template stored in a public ' folder. ' ' 2) Copies the template to the folder specified by the user's "User ' templates" option setting in Microsoft Word. ' ' 3) Creates a new document based upon the template that was copied to the ' local machine. ' ' The purpose of this script is to prevent an administrative issue. Whenever ' you create a new document based upon a template, the template becomes ' "attached" to the new document. This effectively locks the template file ' whenever a document is open that is based upon the template. This makes it ' difficult for the person maintaining templates that are stored on the ' network -- you either need to have every user close any documents that are ' based upon the template, or you must logon to the file server that hosts the ' network location of the template and break all locks to the template. ' ' This script essentially works around the problem by ensuring that the user ' has the latest version of a particular template on their own hard drive, and ' then creating the document based upon the local copy of the template. ' ' Notes: ' ' 1) This script uses a File Open dialog control that supposedly only works on ' Windows XP. ' ' 2) This script assumes that the script itself is stored in the same location ' as the templates. However, it would be a trivial matter to change the ' script to look for the templates in a different location. ' ' 3) This script will not prevent users from creating new documents based ' directly upon templates stored on the network. To encourage users to use ' this script, it is suggested that a shortcut directly to the script be ' deployed to users. On Error Resume Next ' Create a file system object (to be used later in several ways). Set objFSO = CreateObject("Scripting.FileSystemObject") ' Create an Open File dialog object and prompt the user for the desired. Note ' that the GetParentFolderName method call is used to find the location of this ' script, which is in turn used for the initial directory to present to the ' user. Set objDialog = CreateObject("UserAccounts.CommonDialog") objDialog.Filter = "Document Templates|*.dot" objDialog.FilterIndex = 1 objDialog.InitialDir = objFSO.GetParentFolderName(WScript.ScriptFullName) intResult = objDialog.ShowOpen ' Exit now if user did not select a template. If intResult = 0 Then Wscript.Quit End If ' Create an MS Word object, and ensure that MS Word will be visible and that it ' has focus when this script ends. Set objWord = CreateObject("Word.Application") objWord.Visible = True objWord.Activate() ' Get access to the user's MS Word options. Set objOptions = objWord.Options ' Set a constant that corresponds to the "User templates" file location. Const wdUserTemplatesPath = 2 ' Get access to the properties of the template stored on the network, using the ' full path returned by the File Open dialog. Set objRemoteFile = objFSO.GetFile(objDialog.Filename) ' Form the full path for the local template, using the path from the user's ' "User templates" setting and the name of the template. strLocalFile = objOptions.DefaultFilePath(wdUserTemplatesPath) & "\" & objRemoteFile.Name ' Copy the file from the network location to the newly formed local path. The ' third argument is set to "true" to ensure that any template that already ' exists locally is replaced by the version from the network (in case there have ' been updates to the template since the last time it was copied locally). objFSO.CopyFile objDialog.FileName, strLocalFile, true ' Create a new document based upon the desired template that is now stored on ' the local machine. Set objDoc = objWord.Documents.Add(strLocalFile, false) ' Get out of Dodge. Wscript.Quit end script |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
EnvelopeExtra1 on a network? | Microsoft Word Help | |||
Accessing Templates in Word 2002 | Microsoft Word Help | |||
Sharing custom dictionaries across the network | Microsoft Word Help | |||
Get 'Workgroup Templates' to show up in 'New Document' Task Pane? | Microsoft Word Help | |||
Templates in too many languages. Only need English. | Microsoft Word Help |