TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Re: Best practices for distributing custom templates?
Subject:Re: Best practices for distributing custom templates? From:holmegm -at- comcast -dot- net To:"TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com> Date:Fri, 02 Apr 2004 13:10:27 +0000
Geoff Hart <ghart -at- videotron -dot- ca>
>The most effective approach _if you have "managed" PCs_ is for the head
>of your computer department use the remote administration tools
>provided by the PC's manufacturer. These tools let administrators
>install software updates directly over the network on all managed PCs.
If you don't have that setup, or if working within that structure where
you are happens to be as pleasant as a root canal, you could do what I
did (assuming a basic knowledge of windows scripting):
1. Create a shared folder for the templates your team is to use (I assume
that you were going to do this anyway).
2. Create a second shared folder for the startup scripts that you will
use to push the templates, startup scripts, and any changes to either
out.
3. Create two VBS script files, place them in the shared folder for startup
scripts, and email them to your team members. They only have to run
them once - they'll get placed in the startup directory and be run
every time they log in.
(hope this makes it through filters)(watch the line wrap):
'=========start copyStartupScripts.vbs===========
'determine where the local Startup directory is
Dim WSHShell,strRegKey, LocationDestination
'Create the Wscript Shell object, which contains the Registry methods
Set WSHShell = WScript.CreateObject("WScript.Shell")
strRegKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Startup"
LocationDestination = WSHShell.RegRead(strRegKey)
'where to get startup scripts from
Dim LocationSource
LocationSource = "\\sharedserver\share\somedirectory\templates\StartUpScripts"
'create a file system object, to copy the folder from the network to the local startup folder
Dim fso, fldr, Folder
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
'copy the contents of the network folder to the local folder
fso.CopyFolder LocationSource, LocationDestination
'clean up the file system object
Set fso = Nothing
'=========end of copyStartupScripts.vbs===========
The actual script that will copy the templates out is:
Dim ApWord 'To open Word
Set ApWord = WScript.CreateObject("Word.application") 'Creates an object
ApWord.Visible = False ' So you can't see Word
Dim theTemplateFileLocationDestination, theTemplateFileLocationSource
'where we get the good template directory from
theTemplateFileLocationSource="\\sharedserver\share\somedirectory\templates\TeamName"
'where it should go
theTemplateFileLocationDestination=ApWord.Options.DefaultFilePath(wdUserTemplatesPath)
'Close Word
ApWord.Quit()
Set ApWord = Nothing
'create a file system object, to copy the folder from the network to the local template folder
Dim fso, fldr, Folder
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
'test if the folder exists; if not, create it
On Error Resume Next
Set Folder = fso.GetFolder( theTemplateFileLocationDestination & "\TeamName")
If Hex(Err.number) = "4C" Then
fso.CreateFolder ( theTemplateFileLocationDestination & "\TeamName")
End If
On Error Goto 0
'copy the contents of the network folder to the local folder
fso.CopyFolder theTemplateFileLocationSource, theTemplateFileLocationDestination & "\TeamName"
'clean up the file system object
Set fso = Nothing
'======End of CopyTheTeamWordTemplates.vbs==============
Obviously, you need to customize these to suit, and test them before
you send them out.
This method actually creates a subdirectory in the local templates folder,
which shows up as a tab in the "File -> New..." dialog.
If anyone sees improvements to those scripts, please let me know! They've
been working, but I'm no scripting expert so there may be flaws ...
Have you tried the latest in Help Authoring from RoboHelp?
Try ROBOHELP X5 for Free - Now with Word 2003 support, Content
Management, Multi-Author support, PDF and XML support and much more!
---
You are currently subscribed to techwr-l as:
archiver -at- techwr-l -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit http://www.raycomm.com/techwhirl/ for more resources and info.