BuildingBlockGalleryContentControl.BuildingBlockCategory (Propiedad) (2007 System)
Actualización: Julio de 2008
Obtiene o establece la categoría de los bloques de creación que se muestran en BuildingBlockGalleryContentControl.
Espacio de nombres: Microsoft.Office.Tools.Word
Ensamblado: Microsoft.Office.Tools.Word.v9.0 (en Microsoft.Office.Tools.Word.v9.0.dll)
Sintaxis
Public Property BuildingBlockCategory As String
Dim instance As BuildingBlockGalleryContentControl
Dim value As String
value = instance.BuildingBlockCategory
instance.BuildingBlockCategory = value
public string BuildingBlockCategory { get; set; }
Valor de propiedad
Tipo: System.String
La categoría de los bloques de creación que se muestran en BuildingBlockGalleryContentControl.
Comentarios
Todos los bloques de creación pertenecen a una categoría y a una galería. Utilice la propiedad BuildingBlockCategory para especificar la categoría de los bloques de creación que se muestran en BuildingBlockGalleryContentControl. Puede establecer el valor de esta propiedad en las categorías Integrado o General definidas en Microsoft Office Word o puede especificar una categoría personalizada.
Para especificar la galería de bloques de creación que se va a mostrar en BuildingBlockGalleryContentControl, utilice la propiedad BuildingBlockType.
Ejemplos
En el ejemplo de código siguiente se agrega un nuevo BuildingBlockGalleryContentControl al principio del documento. BuildingBlockGalleryContentControl muestra los bloques de creación de ecuación proporcionados por Microsoft Office Word. En el ejemplo se establece la propiedad BuildingBlockCategory en la categoría Built-In.
Se trata de una versión para una personalización en el nivel del documento. Para usar este código, péguelo en la clase ThisDocument del proyecto y llame al método AddBuildingBlockControlAtSelection desde el método ThisDocument_Startup.
Dim buildingBlockGalleryControl1 As Microsoft.Office.Tools.Word.BuildingBlockGalleryContentControl
Private Sub AddBuildingBlockGalleryControlAtSelection()
Me.Paragraphs(1).Range.InsertParagraphBefore()
Me.Paragraphs(1).Range.Select()
buildingBlockGalleryControl1 = Me.Controls.AddBuildingBlockGalleryContentControl( _
"buildingBlockGalleryControl1")
With buildingBlockGalleryControl1
.PlaceholderText = "Choose an equation"
.BuildingBlockCategory = "Built-In"
.BuildingBlockType = Word.WdBuildingBlockTypes.wdTypeEquations
End With
End Sub
private Microsoft.Office.Tools.Word.BuildingBlockGalleryContentControl buildingBlockControl1;
private void AddBuildingBlockControlAtSelection()
{
this.Paragraphs[1].Range.InsertParagraphBefore();
this.Paragraphs[1].Range.Select();
buildingBlockControl1 = this.Controls.AddBuildingBlockGalleryContentControl(
"buildingBlockControl1");
buildingBlockControl1.PlaceholderText = "Choose an equation";
buildingBlockControl1.BuildingBlockCategory = "Built-In";
buildingBlockControl1.BuildingBlockType = Word.WdBuildingBlockTypes.wdTypeEquations;
}
Se trata de una versión para un complemento en el nivel de la aplicación. Para usar este código, péguelo en la clase ThisAddIn del proyecto y llame al método AddBuildingBlockControlAtSelection desde el método ThisAddIn_Startup.
Dim buildingBlockGalleryControl1 As BuildingBlockGalleryContentControl
Private Sub AddBuildingBlockGalleryControlAtSelection()
If Me.Application.ActiveDocument Is Nothing Then
Return
End If
Dim vstoDoc As Document = Me.Application.ActiveDocument.GetVstoObject()
vstoDoc.Paragraphs(1).Range.InsertParagraphBefore()
vstoDoc.Paragraphs(1).Range.Select()
buildingBlockGalleryControl1 = vstoDoc.Controls.AddBuildingBlockGalleryContentControl( _
"buildingBlockGalleryControl1")
With buildingBlockGalleryControl1
.PlaceholderText = "Choose an equation"
.BuildingBlockCategory = "Built-In"
.BuildingBlockType = Word.WdBuildingBlockTypes.wdTypeEquations
End With
End Sub
private Microsoft.Office.Tools.Word.BuildingBlockGalleryContentControl buildingBlockControl1;
private void AddBuildingBlockControlAtSelection()
{
if (this.Application.ActiveDocument == null)
return;
Document vstoDoc = this.Application.ActiveDocument.GetVstoObject();
vstoDoc.Paragraphs[1].Range.InsertParagraphBefore();
vstoDoc.Paragraphs[1].Range.Select();
buildingBlockControl1 = vstoDoc.Controls.AddBuildingBlockGalleryContentControl(
"buildingBlockControl1");
buildingBlockControl1.PlaceholderText = "Choose an equation";
buildingBlockControl1.BuildingBlockCategory = "Built-In";
buildingBlockControl1.BuildingBlockType = Word.WdBuildingBlockTypes.wdTypeEquations;
}
Permisos
- Plena confianza para el llamador inmediato. Un código de confianza parcial no puede utilizar este miembro. Para obtener más información, vea Utilizar bibliotecas de código que no es de plena confianza.
Vea también
Referencia
BuildingBlockGalleryContentControl (Clase)
BuildingBlockGalleryContentControl (Miembros)
Microsoft.Office.Tools.Word (Espacio de nombres)
Historial de cambios
Fecha |
Historial |
Motivo |
---|---|---|
Julio de 2008 |
Agregada una versión del ejemplo de código para un complemento en el nivel de la aplicación. |
Cambio de características de SP1. |