How do i open save dialog for a richtext box?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ooroboo
    New Member
    • Feb 2008
    • 20

    How do i open save dialog for a richtext box?

    i wont have made a simple program for my self , with 2 tabs a text document and a web browser , i have had a little look and could not find a way to open a Save As dialog for my Richtextbox is this possible or how should it be done? ( i wont the Save as dialog to save the richtextbox.tex t as a file with an option to change the file name)

    thanks for your help/ time
  • gobblegob
    New Member
    • Dec 2007
    • 133

    #2
    hi mate this will do what you want.

    (Code) VB6


    Code:
    Private Sub Command1_Click()
        Dim strFileName As String
        CommonDialog1.CancelError = True
        On Error GoTo ErrHandler
        
        CommonDialog1.Filter = "rtf files (*.rtf)|*.rtf"
        CommonDialog1.FilterIndex = 1
        CommonDialog1.ShowSave
        strFileName = CommonDialog1.FileName
        Open strFileName For Output As #1
        Print #1, RichTextBox1.Text
        Close #1
    ErrHandler:
    
    End Sub
    GobbleGob.

    Comment

    Working...