[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2001-08-28
5
Medium Priority
?
273 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 150 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

650 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