Macro for dimension of object

Good Day Dear residents and new participants of CorelDraw COMMUNITY.

I really need help with macros. And the situation is this:
I usually draw a rectangle and write their dimensions (height and width) at the bottom of the rectangle.
Since I have a large amount of work, it takes time to manually type out the dimensions of each rectangle.
For this reaseon, I decided to use special macro which will automatically write
the dimensions (height and width) of object.
I found a macro that only shows the dimensions of a rectangle in a Message Box (MsgBox). But I don't need it.
I just want to have an inscription of the dimensions of the object below the object and that's it.  I will be pleased 

Can You help me with coding macro, which can write the width and height (dimensions) of selected object (even this object isn't curve, but rectangle, triangle, sircle and etc.) ? 

(An approximate algorithm of what I need, I will attach below as a picture)