مشاركة عبر


BuildingBlockGalleryContentControl.BuildingBlockType الخاصية

الحصول أو تعيين نوع كتل الإنشاء التي يتم عرضها في BuildingBlockGalleryContentControl.

مساحة الاسم:  Microsoft.Office.Tools.Word
التجميع:  Microsoft.Office.Tools.Word (في Microsoft.Office.Tools.Word.dll)

بناء الجملة

'إقرار
Property BuildingBlockType As WdBuildingBlockTypes
    Get
    Set
WdBuildingBlockTypes BuildingBlockType { get; set; }

قيمة الخاصية

النوع: Microsoft.Office.Interop.Word.WdBuildingBlockTypes
واحد Microsoft.Office.Interop.Word.WdBuildingBlockTypesقيم.

استثناءات

استثناء: شرط
COMException

خاصية هو تعيين إلى Microsoft.Office.Interop.Word.WdBuildingBlockTypesالقيمة تعرف فئة لكتل الإنشاء التي لا يمكن أن يكون dهوplayed في BuildingBlockGalleryContentControl.

ملاحظات

الجميع إنشاء? كتل تنتمي إلى معرض وفئة. استخدام BuildingBlockTypeخاصية لتحديد أي معرض إنشاء? كتل لعرضها في BuildingBlockGalleryContentControl.

BuildingBlockGalleryContentControlأن يعرض فقط بعض معارض إنشاء? كتل. BuildingBlockTypeيمكن تعيين خاصية فقط إلى ما يلي Microsoft.Office.Interop.Word.WdBuildingBlockTypesقيم:

  • wdTypeAutoText

  • wdTypeCustom1

  • wdTypeCustom2

  • wdTypeCustom3

  • wdTypeCustom4

  • wdTypeCustom5

  • wdTypeCustomAutoText

  • wdTypeCustomEquations

  • wdTypeCustomQuickParts

  • wdTypeCustomTables

  • wdTypeEquations

  • wdTypeQuickParts

  • wdTypeTables

لتعيين فئة لكتل الإنشاء التي يتم عرضها بواسطة BuildingBlockGalleryContentControl، استخدم BuildingBlockCategoryخاصية.

أمثلة

يلي تعليمات برمجية في المثال إضافة جديد BuildingBlockGalleryContentControlإلى بداية مستند. BuildingBlockGalleryContentControlعرض معادلة إنشاء? كتل التي يتم توفيرها من قبل الكلمة Microsoft المكتب 2010 Suite. مثال قم بتعيين BuildingBlockTypeخاصية إلى wdTypeEquations.

Th هو الإصدار هو لتخصيص المستوى مستند. إلى استخدام هذا الرمز، قم بلصقه في إلى ThisDocumentالفئة في مشروع، واستدعاء AddBuildingBlockControlAtSelectionأسلوب من 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;
}

Th هو الإصدار هو للوظيفة الإضافية المستوى تطبيق. إلى استخدام هذا الرمز، قم بلصقه في إلى ThisAddInالفئة في مشروع، واستدعاء AddBuildingBlockControlAtSelectionأسلوب من ThisAddIn_Startupالأسلوب.

Dim buildingBlockGalleryControl1 As BuildingBlockGalleryContentControl

Private Sub AddBuildingBlockGalleryControlAtSelection()
    If Me.Application.ActiveDocument Is Nothing Then
        Return
    End If

    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    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 = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    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;
}

أمن NET Framework.

راجع أيضًَا

المرجع

BuildingBlockGalleryContentControl واجهة

BuildingBlockGalleryContentControl الأعضاء

Microsoft.Office.Tools.Word مساحة الاسم