macro that can group entire objects on the all page of a file

hi is there any macro that can group and ungroup entire object on all page of file in once.