Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jun 2005
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save as RTF - big files (WordXP)

    I need to save some Word documents as RTF.
    When I save them manually using the "File/SaveAs" menu the documents become twice the size.
    However, when I save them using a macro - Activedocument.saveas (fileformat:=wdformatRTF) the size of the document blows out to 100 times the size.
    I was wondering how to programmatically save a document as RTF without the large size.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Save as RTF - big files (WordXP)

    In theory, the result should be the same. If you use the macro recorder to record saving the file interactively in RTF format, what does the code look like? I get this, which I broke onto separate lines for ease of reading:

    <code>ActiveDocument.SaveAs _
    FileName:="This is a test.rtf", _
    FileFormat:=wdFormatRTF, _
    LockComments:=False, _
    Password:="", _
    AddToRecentFiles:=True, _
    WritePassword:="", _
    ReadOnlyRecommended:=False, _
    EmbedTrueTypeFonts:=False, _
    SaveNativePictureFormat:=False, _
    SaveFormsData:=False, _
    SaveAsAOCELetter:=False</code>

    Just as a footnote, make sure you are not using the Word 6/95 RTF converter (the numeric format code would show up in the Immediate Window if you run this macro:

    <code>Sub DumpFileConvertersThatCanSave()
    Dim fc As Word.FileConverter
    For Each fc In Word.FileConverters
    If fc.CanSave Then
    Debug.Print fc.Name, fc.SaveFormat, fc.FormatName
    End If
    Next
    End Sub</code>)

  3. #3
    Star Lounger
    Join Date
    Jun 2005
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save as RTF - big files (WordXP)

    <P ID="edit" class=small>(Edited by jscher2000 on 22-Aug-05 19:23. [pre] and [/pre] tags added to preserve layout.)</P>I got the same result when I used the macro you supplied. How do I know which Fileconverter is being used? When I rant the DumpFileConvertersThatCanSave I got the following results.
    <pre>TXTLYT32.CNV 12 MS-DOS Text with Layout
    TXTLYT32.CNV 13 Text with Layout
    WNWRD232.CNV 14 Word 2.x for Windows
    WORKS432.CNV 26 Works 4.0 for Windows
    WORKS532.CNV 25 Works 2000
    WRD6EX32.CNV 18 Word 6.0/95
    WRD6ER32.CNV 19 Word 97-2002 & 6.0/95 - RTF
    MACWRD32.CNV 15 Word 4.0 for Macintosh
    MACWRD32.CNV 17 Word 5.1 for Macintosh
    MACWRD32.CNV 16 Word 5.0 for Macintosh
    WPFT532.CNV 20 WordPerfect 5.0
    WPFT532.CNV 22 WordPerfect 5.1 for DOS
    WPFT532.CNV 21 WordPerfect 5.0 Secondary File
    WPFT532.CNV 23 WordPerfect 5.1 or 5.2 Secondary File
    WPFT532.CNV 24 WordPerfect 5.x for Windows
    </pre>


  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Save as RTF - big files (WordXP)

    If you use the recorded code in your procedure, does it fix the bloating problem? Just a hope...

    Regarding the converter being used, the constant wdFormatRTF should be a low number. If you place the following code on the line before your SaveAs, you then can check the Immediate window and see whether it was the expected converter:

    debug.print "RTF Converter=" & wdFormatRTF

  5. #5
    Star Lounger
    Join Date
    Jun 2005
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save as RTF - big files (WordXP)

    The wdFormatRTF constant is the number 6.

    I pasted the code into the procedure and it does work. Many thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •