Solved

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

Posted on 2001-08-28
5
225 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

863 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

27 Experts available now in Live!

Get 1:1 Help Now