is it possible to unhide all groups using a macro?

I want to unhide all groups in a calc document, would it be possible to do this using a macro?

If so could you recommend me a macro to do this?

You are looking for the showDetail method:

Sub UnhideAllGroups(oSheet As Variant)
Dim oCursor As Variant
	oCursor = oSheet.createCursor()
	oCursor.gotoEndOfUsedArea(True)
	oSheet.showDetail(oCursor.getRangeAddress())
End Sub

Call this like as

Sub tst()
Dim oSheets As Variant
Dim oSheet As Variant
	oSheets = ThisComponent.getSheets()
	oSheet = oSheets.getByIndex(0)
	UnhideAllGroups(oSheet)
End Sub