Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone

I want to create a rich text editor that supports tables similar to MS Word. I really don't like trying to recreate the wheel, but MS Word does not support the accuracy that I desire. As close as I can establish, MS Word only supports accuracy to 1/10 of a point for font size, line spacing, and character spacing, but I need the accuracy of TWIPS.

I have researched this subject for hours and I have not been able to find a solution for creating tables with the RichEditCtrl or CRichEditCtrl. I suppose I should mention that I am using VC++ 6.0 for my programming efforts, and the class members for the CRichEditCtrl or CRichEditView do not support any type of table formatting.

At this point, I am really quite curious how Microsoft achieved this and I am open to possible solutions. My best guess would be that each table cell is an individual RichEditCtrl or CRichEditCtrl.

Thanks In Advance

Bruce
Posted
Comments
Sergey Alexandrovich Kryukov 12-Mar-13 13:56pm    
Apparently, this is possible, but I would advise to go in for something else. RichText format is awkward to use and pretty much obsolete. There is a number of better alternatives: HTML (the simplest!), ISO-standard OpenDocument Format (ODF), event Microsoft Office Open XML. WPF has a concept and serialization of the "Floating Document"...
—SA
idbruce 12-Mar-13 15:37pm    
Thanks for your response

I have no desire to learn new stuff, because I am now getting pretty familiar with the two forementioned interfaces. I am now starting to make headway, since finding this link http://www.codeproject.com/Articles/58354/How-To-Place-Two-Controls-in-the-Same-View

I now have two CRichEditCtrl(s) withn a CRichEditView :) It is a start :)

1 solution

curious, why do you need that accuracy ?

And more importantly, VC6 !!!! IMO, you will not go far with that version of Visual Studio; and AFAIK, the richtext editor will not give you that precision and the final print rendering will need to be done by you (but I'm no expert on that).

Also, if this is for printing and accuracy is really important, it might be better for you to learn Tex (or LaTex) which should give you all the accuracy you need.
 
Share this answer
 
Comments
idbruce 12-Mar-13 15:45pm    
Thanks for the response.

I need the accuracy for document reproduction. In some instances, due to photographic imaging, photocopying, etc...., documents are slightly changed, such as font size, line spacing, etc...

In order to compensate for these changes, documents will need to be created on a TWIPS level.

As far as accuracy goes, I believe almost all measurements of the CRichEditCtrl and CRichEditView, can be converted to TWIPS. In my opinion, 1/1440TH of an inch is pretty darn accurate, which I am sure is undetectable to the human eye.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900