ContentControl.Type 属性

定义

返回或设置内容控件的类型。Returns or sets the type for a content control. 读/写。Read/write.

public:
 property Microsoft::Office::Interop::Word::WdContentControlType Type { Microsoft::Office::Interop::Word::WdContentControlType get(); void set(Microsoft::Office::Interop::Word::WdContentControlType value); };
public Microsoft.Office.Interop.Word.WdContentControlType Type { get; set; }
member this.Type : Microsoft.Office.Interop.Word.WdContentControlType with get, set
Public Property Type As WdContentControlType

属性值

WdContentControlType

WdContentControlType

注解

可以使用属性将 Type 内容控件的类型从一种类型更改为另一种类型。You can use the Type property to change the type of a content control from one type to another. 但是,可以更改控件的类型取决于原始类型和内容控件中的内容更改时。However, the ability to change the type of control depends on the original type and on the content inside the content control at the time of the change. 所有内容控件可以变为富文本或构建基块库类型的内容控件,因为这些类型允许任意内容。All content controls can be changed to rich text or building block gallery type content controls because these types allow arbitrary content. 对于其他类型,如果内容类型是有效的,您想要更改,然后更改类型被允许。For other types, if the content is valid for the type that you want to change to, then changing the type is allowed. 否则,将拒绝该更改,从而导致运行时错误。Otherwise, the change is rejected, resulting in a run-time error.

适用于