DocumentBase.PrintOut Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Prints all or part of the document.
public void PrintOut (ref object background, ref object append, ref object range, ref object outputFileName, ref object from, ref object to, ref object item, ref object copies, ref object pages, ref object pageType, ref object printToFile, ref object collate, ref object activePrinterMacGX, ref object manualDuplexPrint, ref object printZoomColumn, ref object printZoomRow, ref object printZoomPaperWidth, ref object printZoomPaperHeight);
member this.PrintOut : obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj -> unit
Public Sub PrintOut (Optional ByRef background As Object, Optional ByRef append As Object, Optional ByRef range As Object, Optional ByRef outputFileName As Object, Optional ByRef from As Object, Optional ByRef to As Object, Optional ByRef item As Object, Optional ByRef copies As Object, Optional ByRef pages As Object, Optional ByRef pageType As Object, Optional ByRef printToFile As Object, Optional ByRef collate As Object, Optional ByRef activePrinterMacGX As Object, Optional ByRef manualDuplexPrint As Object, Optional ByRef printZoomColumn As Object, Optional ByRef printZoomRow As Object, Optional ByRef printZoomPaperWidth As Object, Optional ByRef printZoomPaperHeight As Object)
Parameters
- background
- Object
true
to have the customization code continue while Microsoft Office Word prints the document.
- append
- Object
true
to append the document to the file specified by the OutputFileName
argument; false
to overwrite the contents of OutputFileName
.
- range
- Object
The page range. Can be any WdPrintOutRange value.
- outputFileName
- Object
If PrintToFile
is true
, this argument specifies the path and file name of the output file.
- from
- Object
The starting page number when Range
is set to wdPrintFromTo.
- to
- Object
The ending page number when Range
is set to wdPrintFromTo.
- item
- Object
The item to be printed. Can be any WdPrintOutItem value.
- copies
- Object
The number of copies to be printed.
- pages
- Object
The page numbers and page ranges to be printed, separated by commas. For example, "2, 6-10" prints page 2 and pages 6 through 10.
- pageType
- Object
The type of pages to be printed. Can be any WdPrintOutPages value.
- printToFile
- Object
true
to send printer instructions to a file. Make sure to specify a file name with OutputFileName
.
- collate
- Object
When printing multiple copies of a document, true
to print all pages of the document before printing the next copy.
- activePrinterMacGX
- Object
This argument is available only in Microsoft Office Macintosh Edition. For additional information about this argument, consult the language reference Help included with Microsoft Office Macintosh Edition.
- manualDuplexPrint
- Object
true
to print a two-sided document on a printer without a duplex printing kit. If this argument is true
, the PrintBackground and PrintReverse properties are ignored. Use the PrintOddPagesInAscendingOrder and PrintEvenPagesInAscendingOrder properties to control the output during manual duplex printing. This argument might not be available to you, depending on the language support (U.S. English, for example) that you selected or installed.
- printZoomColumn
- Object
The number of pages you want Word to fit horizontally on one page. Can be 1, 2, 3, or 4. Use with the PrintZoomRow
argument to print multiple pages on a single sheet.
- printZoomRow
- Object
The number of pages you want Word to fit vertically on one page. Can be 1, 2, or 4. Use with the PrintZoomColumn
argument to print multiple pages on a single sheet.
- printZoomPaperWidth
- Object
The width to which you want Word to scale printed pages, in twips (20 twips = 1 point; 72 points = 1 inch).
- printZoomPaperHeight
- Object
The height to which you want Word to scale printed pages, in twips (20 twips = 1 point; 72 points = 1 inch).
Examples
The following code example uses the PrintOut method to print two copies of the entire document. To use this example, run it from the ThisDocument
class in a document-level project.
private void DocumentPrintOut()
{
object Background = true;
object Range = Word.WdPrintOutRange.wdPrintAllDocument;
object Copies = 2;
object PageType = Word.WdPrintOutPages.wdPrintAllPages;
object PrintToFile = false;
object Collate = false;
object ActivePrinterMacGX = missing;
object ManualDuplexPrint = false;
object PrintZoomColumn = 1;
object PrintZoomRow = 1;
this.PrintOut(ref Background, ref missing, ref Range, ref missing,
ref missing, ref missing, ref missing, ref Copies,
ref missing, ref PageType, ref PrintToFile, ref Collate,
ref missing, ref ManualDuplexPrint, ref PrintZoomColumn,
ref PrintZoomRow, ref missing, ref missing);
}
Private Sub DocumentPrintOut()
Me.PrintOut(Background:=True, Range:=Word.WdPrintOutRange.wdPrintAllDocument, _
Copies:=2, PageType:=Word.WdPrintOutPages.wdPrintAllPages, _
PrintToFile:=False, Collate:=False, ManualDuplexPrint:=False, _
PrintZoomColumn:=1, PrintZoomRow:=1)
End Sub
Remarks
Optional Parameters
For information on optional parameters, see Optional Parameters in Office Solutions.