public XlShape AddCallout(MsoCalloutType type, Single left, Single top, Single width, Single height) { object[] parameters = new object[5]; parameters[0] = type; parameters[1] = left; parameters[2] = top; parameters[3] = width; parameters[4] = height; object returnValue = InstanceType.InvokeMember("AddCallout", BindingFlags.InvokeMethod | BindingFlags.OptionalParamBinding, null, ComReference, parameters, XlLateBindingApiSettings.XlThreadCulture); if (null == returnValue) { return(null); } XlShape newClass = new XlShape(this, returnValue); ListChildReferences.Add(newClass); return(newClass); }
/// <summary>创建一个无边框的线形标注。返回一个代表新标注的 Shape 对象。 /// </summary> /// <param name="Type">标注线的类型。</param> /// <param name="Left">标注边框的左上角相对于文档左上角的位置(以磅为单位)。</param> /// <param name="Top">标注边框的左上角相对于文档左上角的位置(以磅为单位)。</param> /// <param name="Width">标注边框的宽度(以磅为单位)。</param> /// <param name="Height">标注边框的高度(以磅为单位)。</param> /// <returns></returns> public Shape AddCallout(MsoCalloutType Type, float Left, float Top, float Width, float Height) { _objaParameters = new object[5] { Type, Left, Top, Width, Height }; object objShape = _objShapes.GetType().InvokeMember("AddCallout", BindingFlags.InvokeMethod, null, _objShapes, _objaParameters); return new Shape(objShape); }