次の方法で共有


NamedRange.ID Property

Definition

Gets or sets the identifying label for the NamedRange control when the page is saved as a Web page.

public:
 property System::String ^ ID { System::String ^ get(); void set(System::String ^ value); };
public string ID { get; set; }
member this.ID : string with get, set
Public Property ID As String

Property Value

The identifying label for the NamedRange control when the page is saved as a Web page.

Examples

The following code example creates a NamedRange and then uses the ID property to set an ID that will be used if the workbook is saved as a Web page.

This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange idRange;
private void SetID()
{
    idRange = this.Controls.AddNamedRange(
        this.Range["B4"], "idRange");
    this.idRange.ID = "Lastname";
}
Private idRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub SetID()
    idRange = Me.Controls.AddNamedRange(Me.Range("B4"), "idRange")
    Me.idRange.ID = "Lastname"
End Sub

Remarks

Using this property on a NamedRange control that contains multiple cells will cause an exception to be thrown.

You can use an ID label as a hyperlink reference in other HTML documents or on the same Web page.

Applies to