When you open a Word 2003 document in Word 2007, auto-hyphenated text appears differently from how it appears in Word 2003

Symptoms

When you open a Microsoft Office Word 2003 document in Microsoft Office Word 2007, auto-hyphenated text appears differently from how it appears in Word 2003.

Cause

This issue occurs because the auto-hyphenation engine in Word 2007 has changed from the version of the engine that is included in Word 2003.

Resolution

To resolve this issue, apply hotfix 960556 to Word 2003.


For more information, click the following article number to view the article in the Microsoft Knowledge Base:
960556 Description of the Word 2003 hotfix package (Winword.msp, Wordom.msp): December 16, 2008

This hotfix updates both Winword.exe and Msword.olb to provide functionality for the following Visual Basic for Application (VBA) code. This code converts auto-hyphenation into manual hyphenation. After you run this code on the document in Word 2003 and then save the file, the hyphenation functionality does not change when you open Word 2003 document in Word 2007:
Function ConvertDocument(strFile As String) As Boolean
ConvertDocument = False

Dim doc As Document
Set doc = Documents.Open(strFile)
If (Not doc Is Nothing) Then
' Force view to be PrintPreview.
doc.PrintPreview
' Make sure the doc has been entirely paginated.
doc.Repaginate
' Turn all automatic hyphens into manual hyphens.
doc.ConvertAutoHyphens
' Disable future automatic hyphenation.
doc.AutoHyphenation = False
doc.Save
doc.Close
' Success.
ConvertDocument = True
End If
End Function

Sub ConvertAllDocuments(strFolder As String)
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(strFolder)

' Process .doc files immediately in the folder.
For Each file In folder.Files
If (StrComp(".doc", Right(file.Name, 4), vbTextCompare) = 0) Then
If (Not ConvertDocument(file.Path)) Then
MsgBox "Unable to process file " + file.Path
End If
End If
Next

' Process files in sub-directories.
For Each subfolder In folder.SubFolders
ConvertAllDocuments (subfolder.Path)
Next
End Sub

Sub BatchConversion()
' Add a ConvertAllDocuments call here for each folder you want to process.
' Example:
' ConvertAllDocuments ("C:\\My Files").
End Sub


Sub UIConversion()
Dim dialog As FileDialog
Set dialog = Application.FileDialog(msoFileDialogFolderPicker)

With dialog
.Title = "Select folder"
.InitialView = msoFileDialogViewList
End With

If dialog.Show <> -1 Then
' User cancelled.
Exit Sub
End If

For Each strFolder In dialog.SelectedItems
ConvertAllDocuments (strFolder)
Next
End Sub
Properties

Article ID: 960557 - Last Review: Aug 13, 2009 - Revision: 1

Feedback