Results 1 to 3 of 3

Thread: How can iuse prinout property of Microsoft office document interface

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    9

    How can iuse prinout property of Microsoft office document interface

    How can iuse prinout property of Microsoft office document interface. please give me example

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How can iuse prinout property of Microsoft office document interface

    Presumably VB6 - Moved from the FAQ Section

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: How can iuse prinout property of Microsoft office document interface

    depending which application you are using, for excel
    sheets("sheet1").printout
    or
    range("a1:f99").printout
    or any sheet or range object
    several arguments are supported, including printer and number of page
    Syntax

    expression.PrintOut(From, To, Copies, Preview, ActivePrinter, PrintToFile, Collate, PrToFileName)

    expression Required. An expression that returns an object in the Applies To list.

    From Optional Variant. The number of the page at which to start printing. If this argument is omitted, printing starts at the beginning.

    To Optional Variant. The number of the last page to print. If this argument is omitted, printing ends with the last page.

    Copies Optional Variant. The number of copies to print. If this argument is omitted, one copy is printed.

    Preview Optional Variant. True to have Microsoft Excel invoke print preview before printing the object. False (or omitted) to print the object immediately.

    ActivePrinter Optional Variant. Sets the name of the active printer.

    PrintToFile Optional Variant. True to print to a file. If PrToFileName is not specified, Microsoft Excel prompts the user to enter the name of the output file.

    Collate Optional Variant. True to collate multiple copies.

    PrToFileName Optional Variant. If PrintToFile is set to True, this argument specifies the name of the file you want to print to.

    Remarks

    "Pages" in the descriptions of From and To refers to printed pages — not overall pages in the sheet or workbook.
    slightly different for each application
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

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