

XML property, which contains all available data. If you need to access other fields of the source, you can look at it's. You can probably make a wrapper for the method to insert a default value in case of an error and use that to build your style. If the fields are missing, the Source.Field() method will throw an error and it will be skipped. Note that i didn't test this and it can probably be done better.

Src.field("Author/b:Author/b:NameList/b:Person:b/First") & ": " & _Įnd For 'source found, skip to next controlĭebug.Print "source " & cc.Tag & " not found" Src.field("Author/b:Author/b:NameList/b:Person:b/Last") & ", " & _ Set srcs = įor Each cc In ActiveDocument.SelectContentControlsByTitle("cit_auto")įor Each src In srcs 'look for the source of the citationĬc.Range.text = _ 'results in: lastname, firstname: title () 'assign variable types to get some form of autocomplete You can iterate the ContentControls in a For Each, select the corresponding Source by matching the ContentControl.Tag with the Source.Field("Tag") and set the to the format you desire: Public Sub FillSources() The function ActiveDocument.SelectContentControlsByTitle returns a ContentControls object instead of a ContentControl array.īoth can be iterated and accessed using their indices, however you cannot pass them as parameter for their corresponding array, in case you want to modularize the code. Note that Bibliography.Sources is a Sources object, and not a Source array.Ī similar issue happens with the content controls. Now, to access the Sources of the current document you can use. You need to enable the 'edit mode'(?) in the developer tools to access the properties of the controls. give it a title like cit_auto and a tag corresponding to your source tag) Now, instead of actual citations, you insert content controls with titles and tags that correspond to the source you want to refer to. To use the content controls you need to enable the developer tools in the settings.

(I didn't reproduce the citations but the bibliography) I ended up using visual basic, as you can actually access the bibliography data this way, so you may be able to reproduce the citation behavior using VBA and content controls.

I looked into the custom styles as well but abandoned the idea as, just like you said, the method didn't work (not even the final code samples at the end of each page).
