ErrObject.Description 屬性

定義

傳回或設定 String 運算式,其中包含與錯誤有關聯的描述性字串。 讀取/寫入

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

屬性值

傳回或設定 String 運算式,其中包含與錯誤有關聯的描述性字串。 讀取/寫入

範例

這個範例會將使用者定義的訊息指派給 Description 對象的屬性 Err

On Error Resume Next
Err.Raise(60000)
Err.Description = "Your Widget needs a new Frob!"
MsgBox(Err.Description)

備註

Description屬性設定是由錯誤的簡短描述所組成。 使用這個屬性,對使用者發出無法或不想處理的錯誤警示。 產生使用者定義的錯誤時,請將錯誤的簡短描述指派給 Description 屬性。 Description如果未填入屬性,而且屬性的值Number會對應至 Visual Basic 運行時間錯誤,則產生錯誤時,函式傳ErrorToString回的字串就會在 屬性中Description設定。

適用於

另請參閱