Solved

Rich Text Box manipulation

Posted on 1998-12-10
6
449 Views
Last Modified: 2010-05-03
If you load an rtf file created in Word into a rich text box, manipulate it, and save it, when you open it in Word again, it has lost a lot of its original formatting - e.g. lines, tables, all tabs except left ones. Is there any way of preserving this formatting?
0
Comment
Question by:peter0031
[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
  • 2
  • 2
6 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 1449196
Hi Peter,

You have to save the file as

Private Sub Command1_Click()
      RichTextBox1.SaveFile Filename, rtfRTF
End Sub

Hope this helps
br(UINT)je


0
 

Author Comment

by:peter0031
ID: 1449197
Thanks for trying, but this does not do it. The savefile method only gives you two options anyway, rtfRTF or rtfText, and rtfRTF is the default.

I have saved the file - it's just that in the process of loading the file into the rich text box, certain formatting is lost - as stated before - it turns all tabs to left tabs and gets rid of tables and lines, not to mention small caps and other wonders.

I need to know whether there is any way of retaining all of the formatting. After all, in Word 7 it says the file is in rich text format, so presumably RTF files support lines, tables etc...it just seems that the RichTextBox itself seems not to.

I am using VB5 currently - does VB6 solve the problem?
0
 
LVL 44

Expert Comment

by:bruintje
ID: 1449198
Well I'll take another look at it. And I don't know, I am using VB5 myself, recently I had someone with the same sort of problem with Outlook and a Richedit box but that was in Delphi.

I'll be back.
:O)
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 12

Accepted Solution

by:
mark2150 earned 100 total points
ID: 1449199
The RTB supplied for VB is *NOT* as complete as that used by Word. It WILL NOT preserve all of the settings as it strips anything it can't understand from the form when it loads.

Supported functions are bold/ital/under, colors, etc. - just the basics. You'll either need to locate/write a more comprehensive control, keep a backup copy with the original formatting, or give up.

M

0
 

Author Comment

by:peter0031
ID: 1449200
Thanks. Does VB6 solve the problem at all?
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1449201
No idea. Doubt it.

M

0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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