Share via


DocumentBase.Bibliography 屬性

取得內含於文件的參考書目參考。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

'宣告
Public ReadOnly Property Bibliography As Bibliography
public Bibliography Bibliography { get; }

屬性值

型別:Microsoft.Office.Interop.Word.Bibliography
Bibliography ,表示內含於文件中的參考書目參考。

範例

下列程式碼範例會將來源加入至目前的清單和來源的主清單。 這個範例接著會在文件結尾加入新段落,並將參考書目插入至此段落,即文件中的最後一個段落。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub AddBibliography()
    Dim guid As String = System.Guid.NewGuid().ToString()
    Dim src As String = _
        "<b:Source><b:Tag>Jam08</b:Tag><b:SourceType>Book</b:SourceType>" _
        + "<b:Guid>" + guid + "</b:Guid><b:LCID>0</b:LCID><b:Author>" _
        + "<b:Author><b:NameList><b:Person><b:Last>Persse</b:Last>" _
        + "<b:First>James</b:First></b:Person></b:NameList></b:Author>" _
        + "</b:Author><b:Title>Hollywood Secrets of Project Management " _
        + "Success</b:Title><b:Year>2008</b:Year><b:City>Redmond</b:City>" _
        + "<b:Publisher>Microsoft Press</b:Publisher></b:Source>"
    Me.Bibliography.Sources.Add(src)

    Me.Bibliography.BibliographyStyle = "APA"
    Me.Paragraphs.Last.Range.InsertParagraphAfter()
    Me.Fields.Add(Me.Paragraphs.Last.Range, _
        Word.WdFieldType.wdFieldBibliography)
End Sub
private void AddBibliography()
{
    string guid = System.Guid.NewGuid().ToString();
    string src = 
        "<b:Source><b:Tag>Jam08</b:Tag><b:SourceType>Book</b:SourceType>" 
        + "<b:Guid>" + guid + "</b:Guid><b:LCID>0</b:LCID><b:Author>" 
        + "<b:Author><b:NameList><b:Person><b:Last>Persse</b:Last>" 
        + "<b:First>James</b:First></b:Person></b:NameList></b:Author>" 
        + "</b:Author><b:Title>Hollywood Secrets of Project Management "
        + "Success</b:Title><b:Year>2008</b:Year><b:City>Redmond</b:City>"
        + "<b:Publisher>Microsoft Press</b:Publisher></b:Source>";
    this.Bibliography.Sources.Add(src);

    this.Bibliography.BibliographyStyle = "APA";
    this.Paragraphs.Last.Range.InsertParagraphAfter();
    object fieldType = Word.WdFieldType.wdFieldBibliography;
    this.Fields.Add(
        this.Paragraphs.Last.Range, 
        ref fieldType, 
        ref missing, 
        ref missing);
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間

其他資源

與書籤項目一起使用