ControlNameAlreadyExistsException 类

在以下情况下引发的异常:您在运行时尝试向 Microsoft Office Excel 工作簿或 Microsoft Office Word 文档中添加控件,但为该新控件提供的名称在该工作簿或文档中已经存在。

继承层次结构

System.Object
  System.Exception
    Microsoft.VisualStudio.Tools.Applications.Runtime.RuntimeException
      Microsoft.Office.Tools.ControlNameAlreadyExistsException

命名空间:  Microsoft.Office.Tools
程序集:  Microsoft.Office.Tools.v4.0.Framework(在 Microsoft.Office.Tools.v4.0.Framework.dll 中)

语法

声明
<SerializableAttribute> _
<SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted := True)> _
<SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Unrestricted := True)> _
Public NotInheritable Class ControlNameAlreadyExistsException _
    Inherits RuntimeException
[SerializableAttribute]
[SecurityPermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
[SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Unrestricted = true)]
public sealed class ControlNameAlreadyExistsException : RuntimeException

ControlNameAlreadyExistsException 类型公开以下成员。

构造函数

  名称 说明
公共方法 ControlNameAlreadyExistsException() 基础结构。
公共方法 ControlNameAlreadyExistsException(Exception) 基础结构。
公共方法 ControlNameAlreadyExistsException(String) 基础结构。
公共方法 ControlNameAlreadyExistsException(String, Exception) 基础结构。
公共方法 ControlNameAlreadyExistsException(String, String) 基础结构。
公共方法 ControlNameAlreadyExistsException(String, String, Exception) 基础结构。

页首

属性

  名称 说明
公共属性 Data 获取一个提供用户定义的其他异常信息的键/值对的集合。 (继承自 Exception。)
公共属性 HelpLink 获取或设置指向此异常所关联帮助文件的链接。 (继承自 Exception。)
受保护的属性 HResult 获取或设置 HRESULT,它是分配给特定异常的编码数值。 (继承自 Exception。)
公共属性 InnerException 获取导致当前异常的 Exception 实例。 (继承自 Exception。)
公共属性 Message 获取描述当前异常的消息。 (继承自 Exception。)
公共属性 Source 获取或设置导致错误的应用程序或对象的名称。 (继承自 Exception。)
公共属性 StackTrace 获取调用堆栈上直接帧的字符串表示形式。 (继承自 Exception。)
公共属性 TargetSite 获取引发当前异常的方法。 (继承自 Exception。)

页首

方法

  名称 说明
公共方法 Equals 确定指定的 Object 是否等于当前的 Object。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetBaseException 当在派生类中重写时,返回 Exception,它是一个或多个并发的异常的根源。 (继承自 Exception。)
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetObjectData 当在派生类中重写时,用关于异常的信息设置 SerializationInfo。 (继承自 Exception。)
公共方法 GetType 获取当前实例的运行时类型。 (继承自 Exception。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
公共方法 ToString 创建并返回当前异常的字符串表示形式。 (继承自 Exception。)

页首

备注

可以使用 Visual Studio 中的 Office 开发工具在运行时向 Word 文档和 Excel 工作簿中添加控件。 有关更多信息,请参见 在运行时向 Office 文档添加控件

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.Office.Tools 命名空间

其他资源

在运行时向 Office 文档添加控件