Results 1 to 6 of 6

Thread: Printing a document

  1. #1

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268
    Can anyone tell me how to sequentially send text to a file and then print it out? Thanks in advance.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  2. #2

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    To clear things up...

    In case I really wasn't clear, I just need to know how to print a document, I'm sure I could figure out how to send the text, I just need to find out how to print it.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  3. #3
    New Member
    Join Date
    Apr 2000
    Posts
    9

    You can use the Printer object directly, doing something like this:

    dim sMyString as string

    sMyString = "Hello World!"

    Printer.Print sMyString


    This will send the sMyString variable directly to the printer. Just use Printer.EndDoc to stop the buffer, and start the printing.

    Daryl
    Daryl Jones
    Software Developer
    [email protected]

  4. #4

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    Post What about a file?

    What about a file? I am wanting to send a series a strings to a file, save that file, then print it using VB.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can load the text into a string and then send it to the printer via the printer object

    Printer.print mystring
    Printer.enddoc

    or load the file into a RichTextBox and use
    RTB1.selPrint(Printer.hDC)

    With the RTB you could add color or formatting or whatever

    To open the file into a string look up the FileSystemObject and OpenAsTextStream

  6. #6

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    Smile Thanks

    Thanks, that one's been bugging me a while.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width