Article ID: 185055
Article Last Modified on 6/17/2005
Save as a Word document.
Text Only: Saves text without its formatting. Converts all section breaks, page breaks, and newline characters to paragraph marks. Uses the ANSI character set. Select this format only if the destination program cannot read any of the other available file formats.
MS-DOS Text: Converts files the same way as Text only format (wdFormatText). Uses the extended ASCII character set, which is the standard for MS-DOS-based programs. Use this format to share documents between Word and non-Windows-based programs.
Text only with line breaks: Saves text without formatting. Converts all line breaks, section breaks, and page breaks to paragraph marks. Use this format when you want to maintain line breaks, for example, when transferring documents to an electronic mail system.
MS-DOS text only with line breaks: Saves text without formatting. Converts all line breaks, section breaks, and page breaks to paragraph marks. Use this format when you want to maintain line breaks. For example, when transferring documents to an electronic mail system.
Rich Text Format (RTF): Saves all formatting. Converts formatting to instructions that other programs, including compatible Microsoft programs, can read and interpret.
Save as a Word template.
Saves as a Unicode text file. Converts text between common character encoding standards, inclucing Unicode 2.0, Mac OS, Windows, EUC and ISO-8859 series.
Save as a custom dictionary.
Create an exclude dictionary to specify a preferred spelling for a word (for example "gray" instead of "grey"), and add the unwanted version of the word to an exclude dictionary. The next time you check spelling, the spelling checker questions the word so you can change it to the version you want.
Stationery is a special form of a document that you can use repeatedly as a master for similar documents. When a file is in stationery pad format, you cannot modify it. When you open a stationery pad, a new, untitled document appears that contains the text, styles, and other formatting of the stationery pad. The stationery pad itself does not open, so you cannot modify it.
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.
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
For more information about the SaveFormat Property, from the Visual Basic
Editor, click the Office Assistant, type SaveFormat, click Search, and
then click to view "SaveFormat Property."
176476 OFF: Office Assistant Not Answering Visual Basic Questions
Converter ClassName ---------------------------------------------------- HTML Document HTML Word 4.0 for Macintosh MSWordMac4 Word 5.0 for Macintosh MSWordMac5 Word 5.1 for Macintosh MSWordMac51 Word 6.0/95 MSWord6ExpTo retrieve other class names for an installed converter to Save As, you can loop through the FileConverters collection.
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
For more information about the ClassName property, from the Visual Basic
Editor, click the Office Assistant, type ClassName, click Search, and
then click to view "ClassName Property."
For additional information, please see the following article in the
Microsoft Knowledge Base:
181058 OFF98: How to Run Sample Code from Knowledge Base Articles
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: wordcon vba vbe vb
Keywords: kbhowto kbconversion kbdtacode KB185055