Solved

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

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

738 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