My company is preparing to migrate from Office 2003 to Office 2007. Someone asked if in the package we could set Word not to include extra spacing after paragraphs of the same style. To my understanding, this is a per-user setting rather than a per-machine setting, changing the Normal.dotm template at C:\Documents and Settings\[user_name]\Application Data\Microsoft\Templates. Plus I don't see the option anywhere in the Offce Customization Tool.

If my thinking is right, that means each user will have to make the change. Just curious if anyone can confirm that.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
No. I couldnt find it in OCT either, so I decided to use the automation object. I found that sometimes, but not every time, the creation of normal.dotm produced an error if normal.dot didn't exist. So, as a safety precaution, I generated normal.dot first.

The reason I also did it this way is to ensure existing templates which users have created were not fully overwritten (we're replacing manually installed Office 2007 installs by the 'managed' version from our deployment tool). Yes, I force the font change/line spacing to suit company standards, but some users may have other customizations in their template (such as macros, etc etc) so this is ultimately why I chose automation.

This is currently in the testing phase for myself, so I suggest you do some testing too (and let me know your findings!) [:D]


Option Explicit
On Error Resume Next

'***We need to create normal.dot first, otherwise creation of normal.dotm *sometimes* fails if .dot doesn't already exist.
'Word 2003
generateTemplate("Normal.dot")

'Word 2007
generateTemplate("Normal.dotm")

'Outlook 2007
generateTemplate("NormalEmail.dotm")

Function generateTemplate(fname)

'Create shell object
Dim objShell
Set objShell = CreateObject("Wscript.Shell")

'Generate path to normal.dot
Dim templateFolderPath : templateFolderPath = objShell.Environment("Volatile").Item ("APPDATA") & "\Microsoft\Templates\"
Dim templateFilePath : templateFilePath = templateFolderPath & fname

'Create filesystemobject
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

'Create Word automation object
Dim Word
Set Word = CreateObject ("word.application")


Dim wordDoc
Const wdColorBlack = &H000000
Const wdLineSpacingSingle = 0


If fso.FileExists(templateFilePath) Then
'open template
Set wordDoc = Word.Documents.Open(templateFilePath)
Else
'create template path if not exist. This usually automates when you run the script interactively, but
'didnt when I ran it from my deployment tool. I'd keep it here just in case.
If Not fso.FolderExists(templateFolderPath) Then
fso.CreateFolder(templateFolderPath)
End If

'create template
Set wordDoc = Word.Documents.Add
End If


'change font to Arial, 11, not bold, black, single line spacing
Dim objSelection
Set objSelection = Word.Selection
objSelection.Font.Name = "Arial"
objSelection.Font.Size = "11"
objSelection.Font.Bold = False
objSelection.Font.color = wdColorBlack
objSelection.ParagraphFormat.LineSpacingRule = wdLineSpacingSingle
objSelection.ParagraphFormat.SpaceAfter = 0

Const wdFormatTemplate = 1
Const wdFormatXMLTemplateMacroEnabled = 15

'get template type
Dim templateType : templateType = Right(templateFilePath, Len(templateFilePath) - InStrRev(templateFilePath, "."))

'save .dot file
Select Case templateType
Case("dot")
wordDoc.SaveAs templateFilePath, wdFormatTemplate
Case("dotm")
wordDoc.SaveAs templateFilePath, wdFormatXMLTemplateMacroEnabled
End Select

'close word document
wordDoc.close

'quit automation object
Word.Quit

'release object
Set Word = Nothing

'release other objects
Set fso = Nothing
Set objShell = Nothing

End Function
Answered 09/23/2009 by: captain_planet
Third Degree Brown Belt

Please log in to comment
0
I never quite understood why MS set up the default template that way. I think it's likely to have been to accomodate touch typists who, in the days of typewriters would hit CR twice to start a new paragraph.
that means each user will have to make the changeInteresting...I didn't know that that was now the location of the global template(s).

In older flavours of Office, I have always steered clear of making changes to NORMAL.DOT as, when it gets corrupted, Word creates a new one, thus obliterating any changes within. I prefer to create new templates and have Word load them at start-up, using the 'Startup' folder. This is quite a trivial change, though, and if the file were to get corrupted, it's not hard for users to change.

Alternatively, you could set up a script to be executed by Active Setup which uses Word Automation to set the paragraph spacing, along with any other customisations you might want.
Answered 09/23/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity