Microsoft Office Tutorials and References
In Depth Information
19.3.41 PrintPreview Method
Setting PrintToFile to True causes Excel to print to a file. Excel will prompt the user for the
name of the output file. (Unfortunately, there is no way to specify the name of the output file in
code!)
The Collate parameter should be set to True to collate multiple multipage copies.
19.3.41 PrintPreview Method
This method invokes Excel's print preview feature for the given range (this method applies to the
same list of objects as the PrintOut method). Its syntax is:
RangeObject .PrintPreview
19.3.42 Replace Method
This method finds and replaces specified data in all cells in a range. It has no effect on the
selection or the active cell. The syntax is:
RangeObject .Replace( What , Replacement , LookAt , _
SearchOrder , MatchCase , MatchByte )
The What parameter is the data to search for, and the Replacement parameter is the
replacement data. These data can be strings or any other valid Excel data types (numbers, dates,
etc.).
The LookAt parameter is one of the following constants that determines whether the What value
must match the cell's entire contents or just any part of the cell's contents:
Enum XlLookAt
xlWhole = 1
xlPart = 2
End Enum
The SearchOrder parameter is one of the following XlSearchOrder constants:
Enum XlSearchOrder
xlByRows = 1
xlByColumns = 2
End Enum
The MatchCase parameter should be set to True to do a case-sensitive search (the default is
False ). The MatchByte parameter is used only in the Far East version of Microsoft Excel. See
the help documentation for details.
Note that the values of the LookAt , SearchOrder , MatchCase , and MatchByte parameters
are saved each time the Find method is invoked and then reused for the next call to this method.
Note also that setting these arguments changes the corresponding settings in Excel's Find dialog
box, and conversely, changing the settings in the Find dialog box changes the values of these
parameters. This implies that we cannot rely on the values of these parameters, since the user may
have changed them through the Find dialog box. Hence, it is important to specify each of these
arguments for each call to the Find method.
If the contents of the What argument are found at least once, the Replace method returns True .
Search JabSto ::




Custom Search