April 21st, 2009, 06:59 PM
[RESOLVED] printing files (or richTextBox in Forms)
What I really want to do is to print a richTextBox from inside my app. However, after looking around, that looks like it will take about 100 lines of code, and I'd rather invest my time in adding other functionality.
If I save a temporary file, how can I print it from VC++ using windows rather than handling the print task within my app? (i.e. as though I'd right-clicked the file in windows and selected the "Print" option)
Does someone have a good vc++ (i.e. non-VB) link for setting up a print document including rich text?
Thanks in advance for your help.
April 24th, 2009, 09:31 PM
Re: printing files (or richTextBox in Forms)
Found a workable solution, if anyone else has this same question.
1) Save your richTextBox to a temp file.
2) (Straight from msdn but a little hard to find)
Process^ myProcess = gcnew Process;
myProcess->StartInfo->FileName = "..."; //... = path of the file
myProcess->StartInfo->Verb = "Print";
myProcess->StartInfo->CreateNoWindow = true;
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.