ERROR MESSAGE
When you try to save a Word document in a particular file format using a Visual Basic for Applications macro, the following error message may appear:
Run-time error '5880':
No registered converter supports reading files in this format.
For example, this error message appears when you run the following macro code:
Sub MyFileSave
ActiveDocument.SaveAs "My Document File.doc", _
FileFormat:=Application.FileConverters("Text with Layout").SaveFormat
End Sub
NOTE: Microsoft Office 2000 has built-in functionality that allows you to get more information about difficult-to-troubleshoot alerts or error messages. If you want to enable this functionality for this and other error messages in Microsoft Office 2000, please download the Microsoft Office 2000 Customizable Alerts file from the Microsoft Office Update Web site at the following address:
NOTE: If you reached this article by clicking the
Web Info button in an error message, you already have Customizable Alerts enabled.
THINGS TO TRY
The correct external converter name was not used.
The following Visual Basic for Applications macro code checks for each of the converters in the
FileConverters collection. If the converter is found, the macro saves the document in the specified file format. Otherwise, a message box appears indicating the converter was not found.
Sub UseClassName
Dim boolClassNameExist As Boolean
Dim strMsg As String
Dim strFileName As String
Dim fcCnv As FileConverter
strMsg = "The converter was not found."
strFileName = "<filename>"
For Each fcCnv In Application.FileConverters
If fcCnv.ClassName = "<ClassConverterName>" Then
ActiveDocument.SaveAs strFileName, FileFormat:=fcCnv.SaveFormat
boolClassNameExist = True
Exit For
End If
Next fcCnv
If Not boolClassNameExist Then MsgBox strMsg
End Sub
NOTE: You must specify the converter correctly by its proper class name. To determine the proper class name of an external converter (a converter that is not built into the Winword.exe executable), use the following example macro:
Sub FindClassName
For Each aFile In FileConverters
MsgBox aFile
Next aFile
End Sub
The correct internal converter constant was not used.
To save a file using an internal converter (a converter that is built into the Winword.exe executable), you must use a
wdSaveFormat constant, as in the following example macro:
Sub UseWdSaveFormatConstantName()
ActiveDocument.SaveAs FileName:="My Web Page.htm", _
FileFormat:=wdFormatHTML
End Sub
For more information about a wdSaveFormat converter constant, in the Visual Basic Editor, click
Microsoft Visual Basic Help on the
Help menu, type
converter constant in the Office Assistant or the Answer Wizard, and then click
Search to view the topic.