shrinking to guideline is possible? if yes then how?

hi i made this small macro with frame (with the help of MEK code) to shrink inside side and outside. this code helped but this is not exactly solving my problem.
Actually i was trying to do is to make my selection shrink to inside side or outside till my guidelines. if that is possible please let me know

https://we.tl/t-8nbtfrVV2a

Parents
No Data
Reply Children