DocumentBase.Bibliography 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取文档内包含的书目引用。
public Microsoft.Office.Interop.Word.Bibliography Bibliography { get; }
属性值
一个 Bibliography,表示文档内包含的书目引用。
示例
下面的代码示例将源添加到当前列表和源的主列表。 然后,该示例在文档末尾添加一个新段落,并在此段落中插入书目,这是文档中的最后一个段落。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
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);
}
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