excel文件中有多个sheet,想将所有的sheet合到一次打印,该怎么搞?
我现在用_Workbook.PrintOut,但是这样每个sheet都是分开打印的。

解决方案 »

  1.   

    PrintOut(1,&vtMissing,&vtMissing,FALSE,BSTR(lpstrPrinter),false,false);
    你可以看看里面的参数设置,可以一次性打印所有的页.
      

  2.   

    From
    Optional Object. The number of the page at which to start printing. If this argument is omitted, printing starts at the beginning.To
    Optional Object. The number of the last page to print. If this argument is omitted, printing ends with the last page.Copies
    Optional Object. The number of copies to print. If this argument is omitted, one copy is printed.Preview
    Optional Object. True to have Microsoft Excel invoke print preview before printing the object. False (or omitted) to print the object immediately.ActivePrinter
    Optional Object. Sets the name of the active printer.PrintToFile
    Optional Object. 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 Object. True to collate multiple copies.PrToFileName
    Optional Object. If PrintToFile is set to True, this argument specifies the name of the file you want to print to.
    这些参数都没有设置打印所有sheet的选项啊!谁能告诉我该设置哪个啊?谢谢了
      

  3.   

    如果你是用workbook打印,打印的是所有SHEET.
    如果你是用SHEET打印,则是打印当前的SHEET.
    所以,只要是WORKBOOK打印,就会打印全部的SHEET,用不着设置是否是打印所有SHEET了,
      

  4.   

    如果你是用workbook打印,打印的是所有SHEET.
    如果你是用SHEET打印,则是打印当前的SHEET.
    所以,只要是WORKBOOK打印,就会打印全部的SHEET,用不着设置是否是打印所有SHEET了,
      

  5.   

    我明白你的意思。我现在的情况是,会打印所有的sheet,但是是分多次的(打印是通过虚拟打印机来实现的,分多次是指会出现多次调用虚拟打印机,每次打印的结果都是一张sheet的内容)。