Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing from a RichText box

Status
Not open for further replies.

barrytraver

Programmer
Nov 28, 2000
40
US
Using a RichText box, I've been writing my own improved "Notepad," including within my program lots of useful features, such as an MRU ("Most Recently Used") files list (thanks to Rod Stephens) and extra formatting commands to help me with an email newsletter I publish (such as converting the text version to my own preferred HTML version).

I have, however, run into one problem: The File->Print routine is more complicated to write than I had expected (and more complicated than I want to write right now). If you use, for example, a simple Printer.Print rchEditor.Text approach to send the text to the printer, the printer tries to print out an entire paragraph on a single line (with the result that most of it goes off the page) <sigh>.

Thus two questions:

(1) Has anyone released publicly VB source code for an appropriate print routine that would perform similarly to Microsoft Notepad's File->Print routine that I could incorporate into my own VB program?

(2) If not, would it be complicated for me to call Microsoft's Notepad from my own VB program to perform that operation? (I'm a novice at that sort of thing.)

Here's what would my VB program would have to do when File->Print routine was called:

1. Load Notepad with my rchEditor.Text loaded into Microsoft Notepad.
2. Access the File->Print menu option on Microsoft Notepad.
3. Close Microsoft Notepad.

For people who have had experience with things like this, it may be a simple as &quot;1-2-3,&quot; but -- in spite of the fact that I've written lots of VB programs -- I've never had experience with using VB to call up another program.

Any advice would be much appreciated!

Barry Traver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top