How to check in macro if Tracking Changes is enabled?

Hey!
I am writing a small script for the Writer.

I need to get a value of Track Changes option - is it enabled or not.

I want to save the current value of this parameter, change something in the document, and then return the original value back. Is there a way to get this value in a macro?

I can set the value using the code below, but I don’t know how to get it.

sub EnableTrackChanges

dim document   as object
dim dispatcher as object
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "TrackChanges"
args1(0).Value = true
dispatcher.executeDispatch(document, ".uno:TrackChanges", "", 0, args1())
end sub
sub wantToKnow
doc = thisComponent
tracking_enabled = doc.RecordChanges
end sub

Thank you very much. Maybe you also know the similar property for checking “ShowTrackedChanges/HideTrackedChanges”?

I dont know by heart but mri helps me

sub wantToKnow
doc = thisComponent
tracking_enabled = doc.RecordChanges
show_tracking = doc.ShowChanges
end sub
1 Like