CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 1999
    Posts
    74

    RTF file generation

    Hi,

    Does anyone know a source code library (or commercial product) that I can call to create formatted RTF files from my application? I want to generate documents from my application, without learning all the details of the RTF tags.

    Any suggestions most welcome!

    /Magnus Unemyr


  2. #2
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: RTF file generation

    it's in msdn

    CRichEditCtrl::StreamOut
    long StreamOut( int nFormat, EDITSTREAM& es );

    Return Value

    Number of characters written to the output stream.

    Parameters

    nFormat

    Flags specifying the output data formats. See the Remarks section for more information.

    es

    EDITSTREAM structure specifying the output stream. See the Remarks section for more information.

    Remarks

    Call this function to write out the contents of this CRichEditCtrl object to the specified output stream.

    The value of nFormat must be one of the following:

    SF_TEXT Indicates writing text only.


    SF_RTF Indicates writing text and formatting.


    SF_RTFNOOBJS Indicates writing text and formatting, replacing OLE items with spaces.


    SF_TEXTIZED Indicates writing text and formatting, with textual representations of OLE items.

    snip

    Assuming you have a rich edit control simply stream out with SF_RTF



  3. #3
    Join Date
    Dec 1999
    Posts
    74

    Re: RTF file generation

    Hi,

    Thanks for the suggestion, but this assumes the text is already available and formatted in the RichEditControl?

    (=I need to add the RTF tags myself in order to get the formatted text into the RichEditControl in the first place?).

    What I need is a library that created formatted RTF documents without me
    knowing the RTF tags:

    RTF_PrintfHeading1( "Some text" );
    RTF_CreateTable( Columns, Rows );
    ....

    /Magnus


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured