BuildingBlockGalleryContentControl.BuildingBlockCategory-Eigenschaft (2007 System)
Aktualisiert: Juli 2008
Ruft die Kategorie der Bausteine ab, die im BuildingBlockGalleryContentControl angezeigt werden, oder legt die Kategorie fest.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
Public Property BuildingBlockCategory As String
'Usage
Dim instance As BuildingBlockGalleryContentControl
Dim value As String
value = instance.BuildingBlockCategory
instance.BuildingBlockCategory = value
public string BuildingBlockCategory { get; set; }
Eigenschaftenwert
Typ: System.String
Die Kategorie der Bausteine, die im BuildingBlockGalleryContentControl angezeigt werden.
Hinweise
Alle Bausteine gehören zu einer Kategorie und einem Katalog. Mit der BuildingBlockCategory-Eigenschaft geben Sie die Kategorie der Bausteine an, die vom BuildingBlockGalleryContentControl angezeigt werden. Sie können den Wert dieser Eigenschaft auf die Kategorien Built-In oder General festlegen, die in Microsoft Office Word definiert sind, oder Sie geben eine benutzerdefinierte Kategorie an.
Um anzugeben, welcher Bausteinkatalog im BuildingBlockGalleryContentControl angezeigt werden soll, verwenden Sie die BuildingBlockType-Eigenschaft.
Beispiele
Im folgenden Codebeispiel wird am Anfang des Dokuments ein neues BuildingBlockGalleryContentControl hinzugefügt. Das BuildingBlockGalleryContentControl zeigt Formelbausteine an, die von Microsoft Office Word bereitgestellt werden. Im Beispiel wird die BuildingBlockCategory-Eigenschaft auf die Built-In-Kategorie festgelegt.
Diese Version bezieht sich auf eine Anpassung auf Dokumentebene. Zum Verwenden dieses Codes fügen Sie ihn in der ThisDocument-Klasse im Projekt ein, und rufen Sie in der ThisDocument_Startup-Methode die AddBuildingBlockControlAtSelection-Methode auf.
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;
}
Diese Version bezieht sich auf ein Add-In auf Anwendungsebene. Zum Verwenden dieses Codes fügen Sie ihn in der ThisAddIn-Klasse im Projekt ein, und rufen Sie in der ThisAddIn_Startup-Methode die AddBuildingBlockControlAtSelection-Methode auf.
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;
}
Berechtigungen
- Volle Vertrauenswürdigkeit für den unmittelbaren Aufrufer. Dieser Member kann von nur teilweise vertrauenswürdigem Code nicht verwendet werden. Weitere Informationen finden Sie unter Verwenden von Bibliotheken aus teilweise vertrauenswürdigem Code.
Siehe auch
Referenz
BuildingBlockGalleryContentControl-Klasse
BuildingBlockGalleryContentControl-Member
Microsoft.Office.Tools.Word-Namespace
Änderungsprotokoll
Date |
Versionsgeschichte |
Grund |
---|---|---|
Juli 2008 |
Version des Codebeispiels für ein Add-In auf Anwendungsebene hinzugefügt. |
SP1-Featureänderung. |