NamedRange.Width Property
Visual Studio 2012
Gets the width of the NamedRange control in points.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
The following code example creates a NamedRange and then uses the Width and Height properties to display the width and height of the NamedRange.
This example is for a document-level customization.
Microsoft.Office.Tools.Excel.NamedRange heightWidthRange; private void DisplayHeightAndWidth() { heightWidthRange = this.Controls.AddNamedRange( this.Range["B4"], "heightWidthRange"); heightWidthRange.Select(); MessageBox.Show("The NamedRange control is " + this.heightWidthRange.Width + " points wide and " + this.heightWidthRange.Height + " points high."); }
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.