save a text from rich text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anirban
    New Member
    • Sep 2006
    • 17

    save a text from rich text box

    hellow
    how can i do the following job
    i am using rich text box 6.0
    i write something in the rich text box
    how can i save the file in disk as a text document
    which can easily open by any text box editor
    I use common dialog 6.0
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by anirban
    how can i do the following job
    i am using rich text box 6.0
    i write something in the rich text box
    how can i save the file in disk as a text document
    which can easily open by any text box editor
    I use common dialog 6.0
    Check out the .SaveFile method on the RTB control. It allows you to specify file type.

    Comment

    • anirban
      New Member
      • Sep 2006
      • 17

      #3
      Originally posted by Killer42
      Check out the .SaveFile method on the RTB control. It allows you to specify file type.
      I use your suggestion but still the problem is not solved
      I use the following command

      Private Sub mnusave_Click()
      cd.ShowSave
      Form1.Caption = cd.FileName
      rtb.SaveFile Form1.Caption
      End Sub
      Here rtb stand for rich text box & cd stands for common dialog

      the following is save in file where I type just "this is a test page "

      {\rtf1\ansi\ans icpg1252\deff0\ deflang1033{\fo nttbl{\f0\fnil\ fcharset0 MS Sans Serif;}}
      \viewkind4\uc1\ pard\f0\fs17 this is a test page
      \par }

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        You didn't put in the second parameter on the SaveFile.

        Comment

        • ansumansahu
          New Member
          • Mar 2007
          • 149

          #5
          Originally posted by anirban
          hellow
          how can i do the following job
          i am using rich text box 6.0
          i write something in the rich text box
          how can i save the file in disk as a text document
          which can easily open by any text box editor
          I use common dialog 6.0
          Hi ,

          Do this

          RichTextBox1.Sa veFile "YourFileNa me", rtfText

          thanks
          ansuman
          www.mindfiresol utions.com

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            thanx ansu for the advice
            hope his problem is solved.

            Comment

            • anirban
              New Member
              • Sep 2006
              • 17

              #7
              Originally posted by ansumansahu
              Hi ,

              Do this

              RichTextBox1.Sa veFile "YourFileNa me", rtfText

              thanks
              ansuman
              www.mindfiresol utions.com

              the problem solved

              Thanks

              Comment

              Working...