Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Saving dat from multiple rich text boxes to a file

Posted on 1998-11-24
4
Medium Priority
?
137 Views
Last Modified: 2012-05-04
I am trying to save data from nultiple rich text boxes to the same file.  It is only writting the data from the first box out.  When I write the data as text instead of textrtf, then all of the data is outputted, but without the bolding,italic, etc.  This is the code that I am trying to use:
Open "mytext.doc" For Output As 1
        Print #1, RichTextBox3.TextRTF
        Print #1, RichTextBox1.TextRTF
        Print #1, RichTextBox2.TextRTF
        Print #1, RichTextBox4.TextRTF
    Close 1

Any help would be appreciated.
0
Comment
Question by:LesIII
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1446578
Try something like this:

Dim S as string
S=rtf1.textrtf
Put #1,,S

0
 
LVL 12

Accepted Solution

by:
mark2150 earned 200 total points
ID: 1446579
Ummm, RTF isn't a simple format. It starts with { and ends with } and I don't believe that it supports multiple files concatented. You can combine the data all day long, but the multiple preambles are going to *kill* you.

You need to create a 5th RTB that you'll use to concatenate the contents of the other four (you can have the .Visible property = False so the user won't see it.). Select all of the text from each of the other boxes and paste, in sequence, into your 5th box. *THEN* you save the contents of the 5th box to disk with:

Public RTFFile As String    '.RTF file name
SaveFile RTFFile, rtfRTF  'Create file

This should work. Let me know if you need more detailed code on the appending of the text.

M


0
 

Author Comment

by:LesIII
ID: 1446580
Thank you for the answer.  I have been going insane trying to figure out how to use Rich text boxes.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1446581
Wait until you try to figure out how to *PRINT* them! You can set the left and right margins and that is *IT*. It will print multiple pages without page numbers or headings. It does print nicely tho, just doesn't give you any formatting control.

M

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question