DocumentBase.Bibliography, propriété

Obtient les références de bibliographie contenues dans le document.

Espace de noms :  Microsoft.Office.Tools.Word
Assembly :  Microsoft.Office.Tools.Word.v4.0.Utilities (dans Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntaxe

'Déclaration
Public ReadOnly Property Bibliography As Bibliography
    Get
public Bibliography Bibliography { get; }

Valeur de propriété

Type : Microsoft.Office.Interop.Word.Bibliography
Bibliography qui représente les références de bibliographie contenues dans le document.

Exemples

L'exemple de code suivant ajoute une source à la liste actuelle et à la liste principale des sources. Il ajoute ensuite un nouveau paragraphe à la fin du document et y insère la bibliographie. Il s'agit du dernier paragraphe dans le document. Pour utiliser cet exemple, exécutez-le à partir de la classe ThisDocument dans un projet au niveau du document.

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

Sécurité .NET Framework

Voir aussi

Référence

DocumentBase Classe

Microsoft.Office.Tools.Word, espace de noms

Autres ressources

Utiliser des bibliographies