somebody have pity on me… i am so close to getting this… all i am trying to do is export a notes note collection, pipeline to a domparser, modify an attribute, and re-import. my code runs, i get no errors, and msgboxes alert that the value is being updated, but nothing happens… the bgcolor remains “yellow.” any advice?
Sub Initialize
Dim nc As NotesNoteCollection
Set session = New NotesSession
Set db = session.CurrentDatabase
Set nc = db.CreateNoteCollection(False)
Call nc.SelectAllFormatElements(True)
nc.SelectMiscCodeElements = True
nc.SelectMiscFormatElements = True
nc.SelectForms = True
Call nc.BuildCollection
Dim dxp As NotesDXLExporter
Set dxp = session.CreateDXLExporter(nc)
Dim par As NotesDOMParser
Set par = session.CreateDOMParser(dxp)
On Event PostDOMParse From par Call ProcessDOM
Dim dip As NotesDXLImporter
Set dip = session.CreateDXLImporter(par, db)
dxp.Process
End Sub
Sub ProcessDOM(Source As NotesDOMParser)
Dim elems As NotesDOMNodeList
Dim elem As NotesDOMElementNode
Dim attrs As NotesDomNamedNodeMap
Dim NumAttributes As Integer
Dim a As NotesDomAttributeNode
Set elems = Source.Document.GetElementsByTagName("actionbar")
’ Msgbox "elems.NumberOfEntries = " + Cstr( elems.NumberOfEntries )
For i& = 1 To elems.NumberOfEntries
Set elem = elems.GetItem(i&)
Set attrs = elem.Attributes
numAttributes = elem.attributes.numberofentries
' Msgbox Cstr ( numAttributes )
Dim j As Integer
For j = 1 To numAttributes ' Loop through them
Set a = attrs.GetItem(j)
If a.NodeName = "bgcolor" Then
Msgbox "attribute name : " + a.NodeName + " attribute value : " + a.NodeValue
a.NodeValue ="red"
Msgbox "attribute name : " + a.NodeName + " attribute value : " + a.NodeValue
End If
Next
Next
Source.Serialize
End Sub