Class Sources (Word VBA)
The class Sources represents a collection of Source objects. To use a Sources class variable it first needs to be instantiated, for example
Dim srcs as Sources
Set srcs = Application.Bibliography.Sources
For Each
Here is an example of processing the Sources items in a collection.
Dim src As Source
For Each src In Application.Bibliography.Sources
Next src
Add
Add a new source to the sources listed in the Source Manager dialog box.
Add (Data)
Data: An XML string that represents the field values for the new source.
Dim strData As String: strData =
Application.Bibliography.Sources.Add Data:=strData
Count
Returns the number of items in the Sources collection.
Dim lngCount As Long
lngCount = Application.Bibliography.Sources.Count
Item
Returns a Source object that represents the specified item in the collection.
Item (Index)
Index: Specifies the ordinal position of the object within the collection.
Dim src As Source
Set src = Application.Bibliography.Sources(Index:=1)