Results 1 to 3 of 3

Thread: Save in the RTF Format. Amongst Others (Optional)

  1. #1

    Thread Starter
    New Member wowinyou's Avatar
    Join Date
    Feb 2022
    Location
    Somewhere :) :) :)
    Posts
    3

    Save in the RTF Format. Amongst Others (Optional)

    wasn't here for a Small amount of time

    Hello,

    I am making a Thing which has Multiple Formats. I cannot save the Formats with TXT.
    Is there any other Format and how do i Export as "Said" Format?
    The Code i made already to Export is going to be here:
    Code:
    Private Sub SpeichernToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SpeichernToolStripMenuItem.Click
            SaveFileDialog1.Filter = "Textdatei(*.txt) | *.txt | Alle Endungen | *.*| RichTextDatei | *.rtf"
            SaveFileDialog1.ShowDialog()
    
            Dim Location As String
    
            Location = SaveFileDialog1.FileName
    
            My.Computer.FileSystem.WriteAllText(Location & ".txt", "" & ".rtf" & RichTextBox1.Text, True)
        End Sub
    Thanks for Answers (They are Welcome),

    wowinyou

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    33,915

    Re: Save in the RTF Format. Amongst Others (Optional)

    Don't use the .Text property. That only returns the plain text. Use the .RichText property instead. That contains all the Right Text Formatting codes in it.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    108,838

    Re: Save in the RTF Format. Amongst Others (Optional)

    It would be the Rtf property but you don't have to worry about that. The RichTextBox has its own Save File method or the like, so just call that.

Tags for this Thread

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