[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ReplaceOptions

ReplaceOptions Class

Wraps the optional parameters used by Replace(object, object, ReplaceOptions).

Use this class to configure how content is matched and replaced in a range, including whether the search matches the whole cell content or part of it, the search order, case sensitivity, double-byte matching, and optional search and replacement formats. This wrapper keeps the replace API consistent when optional settings are provided.

Inheritance
ReplaceOptions
Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public class ReplaceOptions
Public Class ReplaceOptions
Examples
worksheet.Range["A1:A2"].Value = new object[,] {
    {"Draft"},
    {"Draft plan"}
};
ReplaceOptions options = new ReplaceOptions();
options.LookAt = LookAt.Whole;
worksheet.Range["A1:A2"].Replace("Draft", "Final", options);

Constructors

Name Description
ReplaceOptions()

Properties

Name Description
LookAt

Gets or sets how the search text is matched during a replace operation.

MatchByte

Gets or sets whether replacement matches double-byte characters only.

If this property is true, double-byte characters match only double-byte characters. If this property is false, double-byte characters can match their single-byte equivalents.

Use MatchByte to change this setting for Replace(object, object, ReplaceOptions) operations.

MatchCase

Gets or sets whether the search is case-sensitive.

This option controls whether Replace(object, object, ReplaceOptions) matches letter case when searching text. The default value is false.

ReplaceFormat

Gets or sets the display format applied to replaced cells during a replace operation.

Returns the IDisplayFormat configured for Replace(object, object, ReplaceOptions). When this property is not null, the replace operation uses the specified display format for matched cells after their values are replaced. The default value is null.

SearchFormat

Gets or sets the display format used as the search criterion during a replace operation.

Returns the IDisplayFormat used by Replace(object, object, ReplaceOptions) to limit matching to cells whose displayed formatting matches the specified format. The default value is null.

SearchOrder

Gets or sets the search order.

The search order determines how a range is traversed during a replace operation. For example, ByRows searches across a row before moving to the next row, and ByColumns searches down a column before moving to the next column.