https://bugs.documentfoundation.org/show_bug.cgi?id=160349

--- Comment #3 from Rafael Lima <[email protected]> ---
FTR this is the macro that I created to change the Appearance option. It does
change the appearance option in the registry, but it does not get applied until
LO is restarted. Hence, AFAIK this cannot be achieved solely via macros.

Sub ToggleDarkLight
  Dim oConfigProvider As Object
  Dim oConfigAccess As Object
  Dim pNode(0) As New com.sun.star.beans.PropertyValue
  oConfigProvider =
createUnoService("com.sun.star.configuration.ConfigurationProvider")
  pNode(0).Name = "nodepath"
  pNode(0).Value = "org.openoffice.Office.Common/Misc"
  oConfigAccess =
oConfigProvider.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",
pNode)
  Dim nCurValue As Integer
  nCurValue = oConfigAccess.ApplicationAppearance
  ' Values can be 0: Automatic; 1: Light; 2: Dark
  If nCurValue >= 2 Then
    oConfigAccess.ApplicationAppearance = 0
  Else
    oConfigAccess.ApplicationAppearance = nCurValue + 1
  End If
  oConfigAccess.CommitChanges()
End Sub

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to