Solved

How do you define a FormFeed in a VB 6 RichTextBox?

Posted on 2001-08-28
5
215 Views
Last Modified: 2008-02-01
I can not find a way to get formfeeds to work in a VB 6 RichTextBox. I have created a .RTF file using Word 97 with page breaks defined but when loaded in the VB control they are ignored.

Does anyone know how to get this to work? If it is not supported,  does anyone know about a third party control that supports it?
0
Comment
Question by:BryanC
5 Comments
 
LVL 14

Expert Comment

by:wsh2
ID: 6433681
The RichTextBox is NOT a Printer and as such it has NO page length associated to it. So how you expect it to behave as such? If indeed, you want this type of functionality, then you will just have to hardcode it.
0
 

Author Comment

by:BryanC
ID: 6433846
You are correct, the RichTextBox is not a printer and unless I am mistaken, Microsoft Word is not a printer either. However, it does support such controls and I do want this type of functionality. That was the purpose of the question.
0
 
LVL 4

Expert Comment

by:mcoop
ID: 6434113
I suspect that muh like Word, it is the developer's responsibility to parse the attached RTF data to detect the FF, and other non-printing characters - then represent them in your own manner within the RTF box.

e.g. when you see a FF character - insert a CRLF, then a line of hyphens, then another CRLF... followed by the original RTF data.

Again - in your 'text editor' code, you would need to look for these structures, and skip over them - so the user doesn't corrupt the expanded interpretations you have made.

This may not be the only solution, but I suspect it is close - otherwise the RTF box would have to be incredibly complex to manage all language/font/punctuation variations.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 50 total points
ID: 6434265
BryanC

Wsh2 is correct and your comparison to Word is not relevant.  THe RichTextBox (unlike Word) does not have WYSIWYG printing built in.  You, the programmer, have to add that code.  This is by no means trivial and here is an article from MSDN that may help you understand a little of the complexity ahead of you:

HOWTO: Set Up the RichTextBox Control for WYSIWYG Printing (Q146022)

But to answer your question the RTF code for a hard page break is /page.  You can get more information on the RTF specs from the following article in MSDN:
Rich Text Format (RTF) Specification, version 1.6
It is about 100 pages and has all the information you need to code the printing of your document.

Good luck,
Anthony
0
 

Author Comment

by:BryanC
ID: 6442034
I thank you all for your input.

Anthony, the article you referenced was very good and I will try and use the information supplied in it to solve my problem. If anyone does come across another control that support more features than the Microsoft RichTextBox I would like to know.

Thanks,
Bryan
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now