So, let’s try this macro to replace black with automatic.
I spied on working with the XPathAPI service from @ms777 here.
Sub RemoveBlackColor()
Dim oPackage As Object, oDom As Object, oNode As Object, oXPath As Object, oNodeList As Object
Dim oPackageFolder As Object, oPackageStream As Object, oOutputStream As Object, oTempFile As Object
Dim filePath As String, content As String, arr, nReps As Long, i As Long
filePath=ConvertToUrl("C:\Temp\test.ods")
oPackage=createUnoService("com.sun.star.packages.Package")
oPackage.initialize Array(filePath)
content="content.xml"
oPackageStream=oPackage.getByHierarchicalName(content)
oDom=createUnoService("com.sun.star.xml.dom.DocumentBuilder").parse(oPackageStream.inputStream)
oXPath=createUnoService("com.sun.star.xml.xpath.XPathAPI")
oNodeList=oXPath.selectNodeList(oDom.getDocumentElement, "//*[name()='style:text-properties']")
For i=0 To oNodeList.length-1
oNode=oNodeList.Item(i)
If oNode.getAttribute("color")="#000000" Then
oNode.attributes.removeNamedItem("color")
oNode.setAttribute("fo:color", "")
nReps=nReps+1
End If
Next i
If nReps=0 Then
Msgbox "Replacement color not found"
Exit Sub
End If
oTempFile=createUnoService("com.sun.star.io.TempFile")
oDom.setOutputStream oTempFile.OutputStream
oDom.start
oTempFile.OutputStream.closeOutput
oPackageFolder=oPackage.getByHierarchicalName("")
oPackageStream=oPackage.createInstanceWithArguments(Array(False))
oPackageStream.SetInputStream(oTempFile.InputStream)
oPackageFolder.replaceByName(content, oPackageStream)
oPackage.commitChanges
Msgbox "Replacement done!"
End Sub