A facility introduced in Word 2007 lets you add references to a document and then create a Bibliography at the end of the text. References are stored in a master list, which can be used to add references to further documents. Note that this facility is nowhere near as powerful as the. To create a bibliography style, we will create an XML style sheet; that is, an.xsl file called MyBookStyle.xsl, using your favorite XML editor. Notepad will do fine. As the name suggests, our example is going to be a style for a 'book' source type. At the top of the file, add the following code. Select the citation, click to the down arrow, and choose Edit Citation in the drop-down menu (in this example, the citation is shown in APA format, see more about formats below): 3. In the Edit Citation dialog box, enter the page numbers you need: For example, in one place of the document, the citation looks like, in another place, it looks. To create a bibliography or a citations list in Zotero, highlight one or more references and then right-click (or control-click on Macs) to select “Create Bibliography from Selected Item (s)”. Then select a citation style for your citation/bibliography format and choose either to create a list of Citations/Notes or a Bibliography. Place the number in parentheses or in square brackets; or Use a superscript (a number above the text line, as for a footnote). Include a page number Add a comma and the page number (s) of the source.
- Create A Numbered Bibliography In Word Form
- How Do I Create A Bibliography In Word
- Create Numbered Bibliography In Word
- Create A Numbered Bibliography In Word Format
Edit a source or a placeholder
To edit source or a placeholder, select it, then click to the down arrow and choose EditSource from the drop-down menu (in this example, the citation is shown in the IEEEformat, see more about formats below):
In the Edit Source dialog box, change or add information you need:
To open all fields for the selected source type, select the Show All Bibliography Fields option:
Cite different pages of one source
Quite often, when using one source, you need to specify pages for different citations. This is easilydone by pointing out directly in the source description. But what to do if, in various citations, it isnecessary to indicate different pages of the same source? Word allows you to create one source forfurther use in the Bibliography or Works Cited, and to specify specific pages in differentcitations to this source.
To add pages to the source in the citation, do the following:
1. Add a citation to the source you have created:
On the References tab, in the Citations & Bibliography group, click the InsertCitation button and choose the source from the list:
2. Select the citation, click to the down arrow, and choose EditCitation in the drop-down menu (in this example, the citation is shown in APA format, seemore about formats below):
3. In the Edit Citation dialog box, enter the page numbers youneed:
For example, in one place of the document, the citation looks like , in another place, it looks like .
Change the citations look
Citations are inserted into the document as regular fields and displayed in the text, enclosed inbrackets. You can change the display of these fields using one of the methods:
- Change the brackets for thecitations.
- Exclude showing the Author, Year, or Title of the citation (depending on theselected style, these fields can be shown differently):
- Select the citation, click to the down arrow, and choose Edit Citation in thedrop-down menu.
- In the Edit Citation dialog box, select the appropriate checkbox to exclude thisfield for the citation.
For example, the citation in APA style: .
Without the title, can look like: .
Citation and bibliography formats
- The American Psychological Association (APA) style is used for academic documents suchas scholarly journal articles and books and in many social sciences.
- The Chicago style is used in history and economics and some social sciences.
- The Modern Language Association (MLA) style is most often used in the arts and thehumanities, especially in English studies, modern languages and kinds of literature, comparativeliterature, literary criticism, media studies, cultural studies, and related disciplines.
- The American Sociological Association (ASA) style is used for writing universityresearch papers in the field of sociology.
- The Institute of Electrical and Electronics Engineers (IEEE) style is used for writingresearch papers, commonly used in technical fields, particularly in computer science.
- Oxford, Harvard, and others.
Some types of documents may require a specific format of citations and bibliography.
See also this tip in French:Comment modifier une citation dans un document.
-->Introduction
The Word object model includes several objects designed for automating the creation of bibliographies. The following table lists the main objects of the Word Bibliography feature. You can use these objects, and additional properties and methods in the Word object model, to add sources to the source lists, cite sources in a document, and manage sources. The objects in the Word model for that you use for managing bibliography sources are shown in the following table.
Object | Description |
---|---|
Source | An individual source, such as a book, journal article, or interview. |
Sources | A collection of Source objects. |
Bibliography | The list of sources cited in the document (the current list) or the list of sources available in the application (in the master list). |
Understanding the source XML
Sources are added to the source lists programmatically by using XML strings. Depending on the type of source you want to add, the required XML structure changes. To determine the XML structure for a source type, you can add the same source type manually, and then view the XML returned. The following steps describe how to do this.
On the References ribbon, click Manage Sources.
In the Source Manager dialog box, click New.
In the Create Source dialog box, select the type of source to create. For this example, select Book.
Fill out the source fields, as shown in the following table:
Field Value Author Andrew Dixon Title Stylish Bibliographies Year 2006 City Chicago Publisher Adventure Works Press Tag name And01 You can view and add information to additional fields by checking Show All Bibliography Fields.
Click OK.
Close the Source Manager dialog box.
Start the Visual Basic Editor (Alt+F11).
Display the Immediate Window (Ctrl+G).
Paste and run the following code.
Sub GetBibliographyXML() Dim strXml As String Dim objSource As Source Set objSource = Application.Bibliography.Sources( _ Application.Bibliography.Sources.Count) Debug.Print objSource.XML End Sub
After following the previous steps, the Immediate Window contains the following XML code.
The Guid and LCID elements are optional, but you can provide values for them if you want. The Guid element value should be a valid GUID, which you can generate programmatically outside the Word object model. (See the Visual Studio documentation or the Windows documentation on MSDN for information about programmatically generating ID.) Word generates GUIDs when users add or edit a source. If you do not add a GUID to the XML and a user then edits a source, Word generates a GUID. This enables Word to determine which source is most recent, based on the value of the GUID, and to prompt whether the user wants Word to update the outdated source to maintain continuity between the master list and the current list.
Create A Numbered Bibliography In Word Form
The LCID specifies the language for the source. (See MSDN for valid language identification values.) Word uses the LCID to know how to display a cited source in a document's bibliography. For example, one source may be written in French, one in English, and one in Japanese. From the LCID, Word determines how to display names (for example, Last, First for English), what punctuation to use (for example, using comma in one language and a semicolon in another), and what strings to use (for example, whether to use 'et al' or another localized form).
After removing optional elements, you may have a structure similar to the following XML structure. (You can determine which elements are required because they do not have a corresponding editable field in the Create Source dialog box. Omitting one or more required element raises a run-time error.)
Now that you have the basic structure of the source XML for a book, you can add additional book sources to the master source list and the current source list. You can locate additional elements by checking the Show All Bibliography Fields check box.
Note
Alternatively, you can obtain the XML from the bibliography source file named 'sources.xml' located at C:Users<user>AppDataRoamingMicrosoftBibliography
. This file stores the master source list for a user.
Adding sources to the master source list and the current source list
Adding sources to the master source list is similar to adding sources to the current source list, with the exception that you access the Sources collection from different main objects. To add a source to the master source list, you access the Sources collection from the Bibliography property of the Application object. To add a source to the current source list, access the Sources collection from the Bibliography property of the Document object.
The following example uses the basic structure determined previously to add another book source to the master source list.
You can change the line Application.Bibliography.Sources.Add strXml
to ActiveDocument.Bibliography.Sources.Add strXml
Inserting a source programmatically into the master source list does not automatically add it to the current source list. However, to add a citation to a document, the source must be listed in the current source list. You can manually copy one or more sources from the master list to the current list by using the Source Manager dialog box, or you can programmatically copy one or more sources from the master list to the current list. The following example copies all sources in the master source to the current source. After the sources are added to your current list, you can insert citations for those sources into a document.
Note
The value of the Tag property must be unique across sources in the current list. Thus the On Error Resume Next
line is needed to allow the code to skip over any sources in the master list that have conflicting tag values in the current list. You can modify this code to capture instances when Word cannot copy a source from the master list to the current list.
Sharing your source list
There may be times when you want to share a source list with others in an organization. When you add sources to the master list, Word adds them to a file names 'sources.xml' located at C:Users<user>AppDataRoamingMicrosoftBibliographysources.xml
. You can share this file with others by giving them the file, which users can then load manually from the Source Manager dialog box or programmatically through code.
Note
When a user loads a source file, this is a one-time-only occurrence and does not change either the existing master list or their current list. They can manually add the items in the shared source file to the current list by using the Source Manager dialog box.
You can programmatically load a shared source. The following example shows how to load a shared source file that is located on a share on a local computer.
Note
Sharing the source.xml source file shares only sources in the master source list. Sources located in the current source are located in a document's data store. You can access this file by saving a document and opening the resulting DOCX file in a file compression application, such as WinZip. You can find the source file at the path 'customXml' with a file name of (or similar to) 'item1.xml'. If you need to share the sources in a document with other users, you can share this file the same way that you would share the master list source file, as described previously.
Sorting the master source list
You can set the sort order in the Source Manager dialog box by using the BibliographySort property. The BibliographySort property can be a String value of 'Author', 'Tag', 'Title', or 'Year'. This object does not alter the sorting of sources in the document's bibliography. The following example sorts the sources by title.
Inserting citations
You can insert a bibliography citation by using the Add method for the Fields collection. The following example inserts a citation at the cursor for the source that you added previously. The text for the field equals the tag value, or the value of the Tag element, which in this case is 'Mor01'. (See the XML code in the AddBibSource subroutine shown previously for the XML string '<b:Tag>Mor01</b:Tag>'.) The value of the Tag element also corresponds to the Tag property for a Source object.
Applying a bibliography style
After you insert a bibliography into a document, you can set the bibliography style. Word formats several different styles of bibliographies. You can set the bibliography style by using the BibliographyStyle property. This property can be one of the following String values:
APA
Chicago
GB7714
GOST - Name Sort
GOST - Title Sort
ISO 690 - First Element Date
ISO 690 - Numerical Reference
MLA
SISTO2
Turabian
How Do I Create A Bibliography In Word
Note
These values are included in Word, but new values may be added at any point in the future as new bibliography styles are defined.
Create Numbered Bibliography In Word
The following example sets the default bibliography style to the MLA style.
Note
You can also define your own documentation style in XML. The directory C:Program FilesMicrosoft OfficeOffice151033BibliographyStyle
contains one XSL file for every documentation style on your computer. Open any file for a sample of how to create your own XSLT. Any user can share a custom bibliography style XSL file by placing it into the above folder on their computer.
Inserting a bibliography
As with citations, bibliographies use fields. To insert a bibliography, you need to insert a field with a wdFieldBibliography constant specified for the field type. The following code inserts a bibliography into the active document at the cursor. This example assumes that the cursor is located at the end of the document or on a new page.
Support and feedback
Create A Numbered Bibliography In Word Format
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.