Class Source (Word VBA)

The class Source represents an individual source, such as a book, journal article, or interview. To use a Source class variable it first needs to be instantiated, for example


Dim src as Source
Set src = Application.Bibliography.Sources(Index:=1)

For Each

Here is an example of processing the Source items in a collection.


Dim src As Source
For Each src In Application.Bibliography.Sources
	
Next src

Cited

Returns a Boolean that represents whether a source has been cited in a document.


Dim booCited As Boolean
booCited = Application.Bibliography.Sources(1).Cited

Delete

Deletes the specified source.


Application.Bibliography.Sources(1).Delete

Field

Returns a String that represents the value of a field in a bibliography source.

The name of the field corresponds to the name of the corresponding XML element in the resulting XML for a bibliography source. You can use the XML property to return the XML for a bibliography source. For more information, see Working with Bibliographies.

Field (Name)

Name: Specifies the name of the field for which to retrieve the value.


Dim strName As String: strName =  
Application.Bibliography.Sources(1).Field(Name:=strName) =

Tag

Returns a String that represents an internal identifying label for a source.


Dim strTag As String
strTag = Application.Bibliography.Sources(1).Tag

XML

Returns a String that represents the XML markup for a Source object.

The Data parameter of the Add method for the Sources object requires a valid XML string that contains data for the necessary elements. Depending on the type of source that you add, the XML may change. To determine what the correct XML needs to be for a specific type of source, create a source through the Create Source dialog box, and then use the XML property to return the correct XML syntax.


Dim strXML As String
strXML = Application.Bibliography.Sources(1).XML