RichTextBox Printing

I have had an already written application thrown at me and don't have time to work on it and was wondering if someone would know a quick fix for this.  I have a rich text box on a form
that it populate with a rtf file that was chosen on a previous screen.  When the print button it click the contents of the box are printed out, but not how the rtf file was created (ie page breaks and font size).  I was wondering what would be the best way to print this out the way that a rtf file would look if it were brought up in say MS Word
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

object.SaveFile(pathname, 0)

{the 0 designates an RTF file save)

and then print it with Word

OR use the following to print selected text in the control, or the whole thing if no text is selected.

Private Sub cmdPrint_Click()
   ' The CommonDialog control is named "dlgPrint."
   dlgPrint.Flags = cdlPDReturnDC + cdlPDNoPageNums
   If rtfData.SelLength = 0 Then
      dlgPrint.Flags = dlgPrint.Flags + cdlPDAllPages
      dlgPrint.Flags = dlgPrint.Flags + cdlPDSelection
   End If
   rtfData.SelPrint dlgPrint.hDC
End Sub

Check out this microsot KB Article...

HOWTO: Set Up the RichTextBox Control for WYSIWYG Printing 
KOCUBAAuthor Commented:

I found this answer in the MSDN Library and tried it. It does not work they way I want. I want to it print out the page breaks also, not just to the end of the page when I bring the file up in word it prints out correctly.


I am looking into your answer, but it will take more time than I wanted to spend on it, so it is going to take me awhile
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

KOCUBAAuthor Commented:

This basically does the same thing as the previous answer.  It does not include the page breaks the way that they are when I look at the document in word.  It just prints a full page and then goes on to the next one,ignore the page break.  The only thing that I can think of do to now is to have the application bring up word and have the user print it out in that.

Any thoughts

I think that may be your best bet - it is klunky, but then you get the entire Word engine to do the rendering and the printing.

Other option would be to look for a component to do it - especially if the formatting is not very complex.
KOCUBAAuthor Commented:
I have found my answer in a previuosly asked question.
I think the Question ID is 10131935

Glad you found your answer! Go to the Experts Exchange forum and ask them to close this thread and refund your 75 points. Be sure to mention this question number: Q.10232726

I am answering this question so it can be saved as a PAQ. I have refunded the points used for this question.

Community Support @ Experts Exchange

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.