WD2000: Err Msg: "Word cannot save files. The converter for this format can only open files."ID: Q224066
|
When you try to save a document in a different file format using a recorded Visual Basic for Applications (VBA) macro, the following error message may appear:
Word cannot save <\016\000> files. The converter for this format can only open files.
http://officeupdate.microsoft.com/2000/downloadDetails/alerts.htmNOTE: If you reached this article by clicking the Web Info button in an error message, you already have Customizable Alerts enabled.
The value assigned as the export converter in the macro is assigned to an import-only converter on the computer on which the macro is being run.
Sub Macro1()
ActiveDocument.SaveAs FileName:="myHTMLdoc", FileFormat:=103
End Sub
Note the number 103 that was recorded for the HTML FileFormat argument.
This number may not be the same on another computer.http://www.microsoft.com/mcsp/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/The following sample Visual Basic for Applications macro saves a document in HTML format on any computer:
Sub SaveAsHTML()
Dim fcCnv As FileConverter
Dim strClass As String
Dim strFileName As String
' If there are no documents open to
' save, exit this routine.
If Documents.Count = 0 Then Exit Sub
' Set the ClassName to use for saving.
strClass = "HTML"
' Set the FileName to use for saving.
strFileName = "MyHTMLdoc"
' Loop through all installed converters.
For Each fcCnv In FileConverters
With fcCnv
' Test for conversion ClassName.
If .ClassName = strClass Then
' Save using the FileConverters.ClassName.
ActiveDocument.SaveAs FileName:=strFileName, _
FileFormat:=.SaveFormat
End If
End With
Next fcCnv
End Sub
Converter ClassName
----------------------------------------------------
HTML Document HTML
MS-DOS Text with Layout MS-DOS Text with Layout
Text with Layout Text with Layout
Word 2.x for Windows MSWordWin2
Converter: Word 4.0 for Macintosh MSWordMac4
Word 5.0 for Macintosh MSWordMac5
Word 5.1 for Macintosh MSWordMac51
WordPerfect 5.0 WrdPrfctDOS50
WordPerfect 5.1 for DOS WrdPrfctDOS51
WordPerfect 5.x for Windows WrdPrfctWin
WordPerfect 5.1 or 5.2 Secondary File WrdPrfctDat
WordPerfect 5.0 Secondary File WrdPrfctDat50
Works 3.0 for Windows MSWorksWin3
Works 4.0 for Windows MSWorksWin4
Word 6.0/95 MSWord6Exp
Word 97 & 6.0/95 - RTF MSWord6RTFExp
To retrieve other class names for an installed converter to use for a Save As operation, you can loop through the FileConverters collection.
The following sample macro loops through all installed converters that you
can use for saving and then inserts the converter name and associated
class name into a blank document:
Sub GetConvClassName()
Dim fcCnv As FileConverter
' Create blank document.
Documents.Add
' Loop through all installed converters.
For Each fcCnv In FileConverters
With fcCnv
' If the converter can be used to save...
If .CanSave = True Then
' Insert the converter name and class name in the document.
Selection.TypeText "Converter: " & .FormatName & vbTab _
& "ClassName: " & .ClassName & vbCr
End If
End With
Next fcCnv
End Sub
Additional query words: OFF2000
Keywords : kbdta
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: June 22, 1999 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |