Example #1
0
 public Range Find(object What, object After, object LookIn, object LookAt, object SearchOrder, XlSearchDirection SearchDirection, object MatchCase, object MatchByte, object SearchFormat)
 {
     throw new NotImplementedException();
 }
        /// <summary>在区域中查找特定信息。
        /// </summary>
        /// <param name="What">要搜索的数据。可为字符串或任意 Microsoft Excel 数据类型。</param>
        /// <param name="After">表示搜索过程将从其之后开始进行的单元格。此单元格对应于从用户界面搜索时的活动单元格的位置。请注意:After 必须是区域中的单个单元格。要记住搜索是从该单元格之后开始的;直到此方法绕回到此单元格时,才对其进行搜索。如果不指定该参数,搜索将从区域的左上角的单元格之后开始。</param>
        /// <param name="LookIn">信息类型。</param>
        /// <param name="LookAt">可为以下 XlLookAt 常量之一:xlWhole 或 xlPart。</param>
        /// <param name="SearchOrder">可为以下 XlSearchOrder 常量之一:xlByRows 或 xlByColumns。</param>
        /// <param name="SearchDirection">搜索的方向。</param>
        /// <param name="MatchCase">如果为 True,则搜索区分大小写。默认值为 False。</param>
        /// <param name="MatchByte">只在已经选择或安装了双字节语言支持时适用。如果为 True,则双字节字符只与双字节字符匹配。如果为 False,则双字节字符可与其对等的单字节字符匹配。</param>
        /// <param name="SearchFormat">搜索的格式。</param>
        public Range Find(object What, Range After = null, object LookIn = null, XlLookAt? LookAt = null, XlSearchOrder? SearchOrder = null, XlSearchDirection SearchDirection = XlSearchDirection.xlNext, bool? MatchCase = null, bool? MatchByte = null, string SearchFormat = null)
        {
            _objaParameters = new object[9] {
                What,
                After == null ? System.Type.Missing : After._objRange,
                LookIn == null ? System.Type.Missing : LookIn,
                LookAt == null ? System.Type.Missing : LookAt,
                SearchOrder == null ? System.Type.Missing : SearchOrder,
                SearchDirection,
                MatchCase == null ? System.Type.Missing : MatchCase,
                MatchByte == null ? System.Type.Missing : MatchByte,
                SearchFormat == null ? System.Type.Missing : SearchFormat
            };

            return new Range(_objRange.GetType().InvokeMember("Find", BindingFlags.InvokeMethod, null, _objRange, _objaParameters));
        }