次の方法で共有


Bookmark.InsertCaption(Object, Object, Object, Object, Object) メソッド

定義

図表番号を Bookmark コントロールの直前または直後に挿入します。

public void InsertCaption (ref object Label, ref object Title, ref object TitleAutoText, ref object Position, ref object ExcludeLabel);
abstract member InsertCaption : obj * obj * obj * obj * obj -> unit
Public Sub InsertCaption (ByRef Label As Object, Optional ByRef Title As Object, Optional ByRef TitleAutoText As Object, Optional ByRef Position As Object, Optional ByRef ExcludeLabel As Object)

パラメーター

Label
Object

挿入する図表番号のラベル。 WdCaptionLabelID.

Title
Object

キャプション内のラベルの直後に挿入されるテキスト (が指定されている場合TitleAutoTextは無視されます)。

TitleAutoText
Object

キャプション内のラベルの直後に内容を挿入する定型句 (でTitle指定されたテキストをオーバーライドします)。

Position
Object

図表番号を Bookmark コントロールの上または下のどちらに挿入するかを指定します。 WdCaptionPosition.

ExcludeLabel
Object

true パラメーターで定義されているように、テキスト ラベルを含めないようにします Label 。 指定されたラベルを含める場合は false

次のコード例では、文書にテキストをBookmark含むコントロールを追加し、ブックマークにキャプションを挿入します。

この例は、ドキュメント レベルのカスタマイズ用です。

private void BookmarkInsertCaption()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "First bookmark";

    object Label = Word.WdCaptionLabelID.wdCaptionFigure;
    object Position = Word.WdCaptionPosition.wdCaptionPositionAbove;
    object ExcludeLabel = false;

    bookmark1.InsertCaption(ref Label, ref missing, ref missing,
        ref Position, ref ExcludeLabel);
}
Private Sub BookmarkInsertCaption()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    Bookmark1.Text = "First bookmark"

    Bookmark1.InsertCaption(Label:=Word.WdCaptionLabelID.wdCaptionFigure, _
        Position:=Word.WdCaptionPosition.wdCaptionPositionAbove, _
        ExcludeLabel:=False)

End Sub

注釈

省略可能のパラメーター

省略可能なパラメーターの詳細については、「 Office ソリューションの省略可能なパラメーター」を参照してください。

適用対象