[RESOLVED] printing files (or richTextBox in Forms)
Hi, guys.
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.
Question:
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)
Alternatively:
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. :)
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)
Code:
Process^ myProcess = gcnew Process;
myProcess->StartInfo->FileName = "..."; //... = path of the file
myProcess->StartInfo->Verb = "Print";
myProcess->StartInfo->CreateNoWindow = true;
myProcess->Start();