Bibliography / References: How to update CurrentList
Hello All,
I need to programmatically update the CurrentList of References in Word.
I don't want to add new entries, but update existing entries by changing only single values in the source XML. The tag remains the same.
My code looks like this:
this.Application.LoadMasterList("Sources.xml");
List<string> currentTags = new List<string>();
foreach (Source currSource in this.Application.ActiveDocument.Bibliography.Sources)
{
currentTags.Add(currSource.Tag);
}
foreach (Source masterSource in Application.Bibliography.Sources)
{
if (currentTags.Contains(masterSource.Tag))
{
this.Application.ActiveDocument.Bibliography.Sources.Add(masterSource.XML);
}
}
The problem now is, that the masterSource.XML can not be added to the current List, because there is already an entry with the same tag.
What I want to do is update this entry with the new entry from the MasterList.
my Source XML looks like this:
<b:Source>
<b:Tag>Some_Tag</b:Tag>
<b:SourceType>Book</b:SourceType>
<b:Guid>{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}</b:Guid>
<b:Title>Template Reference</b:Title>
<b:StandardNumber>Document Number: A-B1234-00000-XX</b:StandardNumber>
<b:Edition>Revision: X</b:Edition>
</b:Source>
The only value that changes is the Editition Value, which I want to update in the CurrentList.
I also tried to delete the source in the CurrentList, which is not possible because there are Citations referencing the source.
Thank you for your Help!