Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8707007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:45:30+00:00 2026-06-13T03:45:30+00:00

I have a vb2010 application and want to save the text as a rtf

  • 0

I have a vb2010 application and want to save the text as a rtf document.

I do as follow:

Dim rtb As New RichTextBox
rtb.Text = "something"
rtb.SaveFile(myfile)

but the file is saved as an empty rtf document.

If I repeat the savefile line (line 3) again, it works and I get my rtf file document exactly as it should be.

Here the “working” code:

Dim rtb As New RichTextBox
rtb.Text = "something"
rtb.SaveFile(myfile)
rtb.SaveFile(myfile)

in other words it is like that the first SaveFile (line 3) instruction initialize the RichtTextBox and the next line (line 4) save the file.

Something is wrong, but I cannot find anything in those only 3 lines of code! Any suggestion? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:45:32+00:00Added an answer on June 13, 2026 at 3:45 am

    I advice you to get RTF from the property ‘Rtf’ and save it to file manually, for example in C#

    (sorry I’m C# programmer, not VB):

            RichTextBox rtb = new RichTextBox();
            rtb.Text = "Something";
            System.IO.File.WriteAllText(@"d:\Something.rtf", rtb.Rtf);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a big and bloated software and I want to add a new
I have a DataGridView in a .Net application (V4 C# VS2010) & want to
Hi want to develop a windows phone application. I have vs2010 ultimate installed in
I have a Silverlight RIA application that uses Forms authentication. We want to pass
I have a WinForms application in which I want to be able to provide
I have created a console application and have it working the way I want
On my WinForm application I have a button (printBtn) and I want to print
Using VS2010 Express, C# and it's WinForms Application. Here I have three text boxes(aTextBox,
I have a windows service application that runs as Local System, and I want
i have a solution with a web application that i want to creat a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.