BuildingBlockGalleryContentControl 클래스(2007 시스템)
업데이트: 2008년 7월
사용자가 문서에 삽입할 수 있는 문서 블록의 갤러리를 나타냅니다.
네임스페이스: Microsoft.Office.Tools.Word
어셈블리: Microsoft.Office.Tools.Word.v9.0(Microsoft.Office.Tools.Word.v9.0.dll)
구문
<DefaultBindingPropertyAttribute("Text")> _
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public NotInheritable Class BuildingBlockGalleryContentControl _
Inherits ContentControlBase _
Implements ISupportInitializeControl, ISupportInitialize
Dim instance As BuildingBlockGalleryContentControl
[DefaultBindingPropertyAttribute("Text")]
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public sealed class BuildingBlockGalleryContentControl : ContentControlBase,
ISupportInitializeControl, ISupportInitialize
설명
BuildingBlockGalleryContentControl에는 사용자가 문서에 삽입할 수 있는 문서 블록의 목록이 표시됩니다. 문서 블록은 여러 번 사용하기 위해 만든 일반적인 표지, 서식 지정된 표 또는 머리글과 같은 콘텐츠 부분입니다. 표시할 문서 블록을 선택하려면 BuildingBlockCategory 및 BuildingBlockType 속성을 사용합니다.
문서 블록에 대한 자세한 내용은 What's New for Developers in Word 2007을 참조하십시오.
콘텐츠 컨트롤
DatePickerContentControl은 Microsoft Office Word의 문서 및 서식 파일을 디자인하는 데 사용할 수 있는 8가지 콘텐츠 컨트롤 중 하나입니다. 콘텐츠 컨트롤에는 폼과 같이 입력이 제어되는 UI(사용자 인터페이스)가 있습니다. 콘텐츠 컨트롤을 사용하여 사용자가 문서 또는 서식 파일의 보호된 섹션을 편집하지 못하도록 할 수 있으며 콘텐츠 컨트롤을 데이터 소스에 바인딩할 수도 있습니다. 자세한 내용은 콘텐츠 컨트롤을 참조하십시오.
예제
다음 코드 예제에서는 문서의 시작 부분에 새 BuildingBlockGalleryContentControl을 추가합니다. BuildingBlockGalleryContentControl은 Microsoft Office Word에서 제공하는 식 문서 블록을 표시합니다.
이 버전은 문서 수준 사용자 지정을 위한 것입니다. 이 코드를 사용하려면 프로젝트의 ThisDocument 클래스에 해당 코드를 붙여넣고 ThisDocument_Startup 메서드에서 AddBuildingBlockControlAtSelection 메서드를 호출합니다.
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;
}
이 버전은 응용 프로그램 수준 추가 기능을 위한 것입니다. 이 코드를 사용하려면 프로젝트의 ThisAddIn 클래스에 해당 코드를 붙여넣고 ThisAddIn_Startup 메서드에서 AddBuildingBlockControlAtSelection 메서드를 호출합니다.
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;
}
상속 계층 구조
System.Object
Microsoft.VisualStudio.Tools.Office.RemoteComponent
Microsoft.VisualStudio.Tools.Office.RemoteBindableComponent
Microsoft.Office.Tools.Word.ContentControlBase
Microsoft.Office.Tools.Word.BuildingBlockGalleryContentControl
스레드로부터의 안전성
이 형식의 모든 공용 static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.
참고 항목
참조
BuildingBlockGalleryContentControl 멤버
Microsoft.Office.Tools.Word 네임스페이스
기타 리소스
변경 기록
날짜 |
변경 내용 |
이유 |
---|---|---|
2008년 7월 |
응용 프로그램 수준 추가 기능의 코드 예제 버전이 추가되었습니다. |
SP1 기능 변경 |