BuildingBlockGalleryContentControl Interface

 

Represents a gallery of document building blocks that users can insert into a document.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

[GuidAttribute("d8d887a2-69fe-4a86-a8dd-352003dc0e7e")]
public interface BuildingBlockGalleryContentControl : ContentControlBase, 
	IBindableComponent, IComponent, IDisposable, ISupportInitialize

NameDescription
System_CAPS_pubpropertyApplication

Gets a Microsoft.Office.Interop.Word.Application that represents the current instance of Microsoft Office Word.

System_CAPS_pubpropertyBindingContext

(Inherited from IBindableComponent.)

System_CAPS_pubpropertyBuildingBlockCategory

Gets or sets the category of the building blocks that are displayed in the BuildingBlockGalleryContentControl.

System_CAPS_pubpropertyBuildingBlockType

Gets or sets the type of the building blocks that are displayed in the BuildingBlockGalleryContentControl.

System_CAPS_pubpropertyContainer

This API supports the product infrastructure and is not intended to be used directly from your code. (Inherited from ContentControlBase.)

System_CAPS_pubpropertyContainerComponent

This API supports the product infrastructure and is not intended to be used directly from your code. (Inherited from ContentControlBase.)

System_CAPS_pubpropertyCreator

Gets a 32-bit integer that indicates the application in which the BuildingBlockGalleryContentControl was created.

System_CAPS_pubpropertyDataBindings

(Inherited from IBindableComponent.)

System_CAPS_pubpropertyDefaultDataSourceUpdateMode

Gets or sets the default DataSourceUpdateMode for the ContentControlBase.(Inherited from ContentControlBase.)

System_CAPS_pubpropertyDefaultTextStyle

Gets the name of the character style to use to format text in the BuildingBlockGalleryContentControl.

System_CAPS_pubpropertyID

Gets a unique number that identifies the content control.(Inherited from ContentControlBase.)

System_CAPS_pubpropertyInnerObject
System_CAPS_pubpropertyLockContentControl

Gets or sets a value that specifies whether the BuildingBlockGalleryContentControl can be deleted from the document.

System_CAPS_pubpropertyLockContents

Gets or sets a value that specifies whether the contents of the BuildingBlockGalleryContentControl can be edited.

System_CAPS_pubpropertyParent

Gets the parent of the BuildingBlockGalleryContentControl.

System_CAPS_pubpropertyParentContentControl

Gets the parent content control of a BuildingBlockGalleryContentControl that is nested in another content control.

System_CAPS_pubpropertyPlaceholderText

Gets or sets the text that is displayed in the BuildingBlockGalleryContentControl until the text is changed by a user action or some other operation.

System_CAPS_pubpropertyRange

Gets a Range that represents the contents of the BuildingBlockGalleryContentControl.

System_CAPS_pubpropertyShowingPlaceholderText

Gets a value that indicates whether the BuildingBlockGalleryContentControl is currently displaying placeholder text.

System_CAPS_pubpropertySite

(Inherited from IComponent.)

System_CAPS_pubpropertyTag

Gets or sets a string that you want to associate with the BuildingBlockGalleryContentControl.

System_CAPS_pubpropertyTemporary

Gets or sets a value that specifies whether the BuildingBlockGalleryContentControl is automatically deleted from the document when the control is edited.

System_CAPS_pubpropertyText

Gets or sets the text in the BuildingBlockGalleryContentControl.

System_CAPS_pubpropertyTitle

Gets or sets the title of the BuildingBlockGalleryContentControl.

NameDescription
System_CAPS_pubmethodBeginInit()

(Inherited from ISupportInitialize.)

System_CAPS_pubmethodCopy()

Copies the BuildingBlockGalleryContentControl from the document to the Clipboard.

System_CAPS_pubmethodCut()

Removes the BuildingBlockGalleryContentControl from the document and adds it to the Clipboard.

System_CAPS_pubmethodDelete(Boolean)

Deletes a dynamically created content control from the document and removes it from the ControlCollection in the document.(Inherited from ContentControlBase.)

System_CAPS_pubmethodDispose()

(Inherited from IDisposable.)

System_CAPS_pubmethodEndInit()

(Inherited from ISupportInitialize.)

System_CAPS_pubmethodSetPlaceholderText(BuildingBlock, Range, String)

Displays text that is in a Microsoft.Office.Interop.Word.BuildingBlock, a Range, or a string as the placeholder text in the BuildingBlockGalleryContentControl.

NameDescription
System_CAPS_pubeventAdded

Occurs after the content control is added to the document. (Inherited from ContentControlBase.)

System_CAPS_pubeventBindingContextChanged

Occurs when the value of the BindingContext property of the ContentControlBase changes.(Inherited from ContentControlBase.)

System_CAPS_pubeventContentUpdating

Occurs just before Microsoft Office Word updates the text in the content control, if the content control is bound to a custom XML part.(Inherited from ContentControlBase.)

System_CAPS_pubeventDeleting

Occurs just before the content control is deleted from the document.(Inherited from ContentControlBase.)

System_CAPS_pubeventDisposed

(Inherited from IComponent.)

System_CAPS_pubeventEntering

Occurs when the user clicks in the content control, or when the cursor is moved into the content control programmatically.(Inherited from ContentControlBase.)

System_CAPS_pubeventExiting

Occurs when the user clicks outside the content control, or when the cursor is moved outside the content control programmatically.(Inherited from ContentControlBase.)

System_CAPS_pubeventStoreUpdating

Occurs just before Microsoft Office Word updates data in a custom XML part that is bound to the content control (that is, after the text in the content control changes).(Inherited from ContentControlBase.)

System_CAPS_pubeventValidated

Occurs when the content control has been successfully validated.(Inherited from ContentControlBase.)

System_CAPS_pubeventValidating

Occurs when the contents of the content control are being validated. (Inherited from ContentControlBase.)

A BuildingBlockGalleryContentControl displays a list of document building blocks that users can insert into a document. A document building block is a piece of content that has been created to be used multiple times, such as a common cover page, a formatted table, or a header. To choose the building blocks that you want to display, use the BuildingBlockCategory and BuildingBlockType properties.

For more information about document building blocks, see What's New for Developers in Word 2007.

System_CAPS_noteNote

This interface is implemented by the Visual Studio Tools for Office runtime. It is not intended to be implemented in your code. For more information, see Visual Studio Tools for Office Runtime Overview.

The BuildingBlockGalleryContentControl is one of eight types of content controls that you can use to design documents and templates in Microsoft Office Word. Content controls have a user interface (UI) that has controlled input like a form. You can use content controls to prevent users from editing protected sections of the document or template, and you can also bind content controls to a data source. For more information, see Content Controls.

This documentation describes the version of this type that is used in Office projects that target the .NET Framework 4 or later. In projects that target the .NET Framework 3.5, this type might have different members and the code examples provided for this type might not work. For documentation about this type in projects that target the .NET Framework 3.5, see the following reference section in the Visual Studio 2008 documentation: http://go.microsoft.com/fwlink/?LinkId=160658.

The following code example adds a new BuildingBlockGalleryContentControl to the beginning of the document. The BuildingBlockGalleryContentControl displays equation building blocks that are provided by Microsoft Office Word.

This version is for a document-level customization. To use this code, paste it into the ThisDocument class in your project, and call the AddBuildingBlockControlAtSelection method from the ThisDocument_Startup method.

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;
}

This version is for an application-level add-in. To use this code, paste it into the ThisAddIn class in your project, and call the AddBuildingBlockControlAtSelection method from the ThisAddIn_Startup method.

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;
}
Return to top
Show: