ContentControl.BuildingBlockType 属性

获取或设置在表示生成块库的 ContentControl 中显示的生成块的类型。

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

语法

声明
Property BuildingBlockType As WdBuildingBlockTypes
WdBuildingBlockTypes BuildingBlockType { get; set; }

属性值

类型:Microsoft.Office.Interop.Word.WdBuildingBlockTypes
在控件中显示的生成块的类别。

异常

异常 条件
COMException

属性设置为 Microsoft.Office.Interop.Word.WdBuildingBlockTypes 值,该值标识无法在 ContentControl 中显示的构造块的类别。

备注

此属性只在 ContentControlType 属性的值为 Microsoft.Office.Interop.Word.WdContentControlType.wdContentControlBuildingBlockGallery 时使用。否则,此属性不起任何作用。

所有构造块都属于一个库和一个类别。使用 BuildingBlockType 属性可指定在 ContentControl 中显示哪个生成块库。

ContentControl 只能显示某些生成块库。BuildingBlockType 属性只能设置为以下 Microsoft.Office.Interop.Word.WdBuildingBlockTypes 值:

  • wdTypeAutoText

  • wdTypeCustom1

  • wdTypeCustom2

  • wdTypeCustom3

  • wdTypeCustom4

  • wdTypeCustom5

  • wdTypeCustomAutoText

  • wdTypeCustomEquations

  • wdTypeCustomQuickParts

  • wdTypeCustomTables

  • wdTypeEquations

  • wdTypeQuickParts

  • wdTypeTables

若要指定由 ContentControl 显示的生成块的类别,请使用 BuildingBlockCategory 属性。

.NET Framework 安全性

请参见

参考

ContentControl 接口

Microsoft.Office.Tools.Word 命名空间