Moving a word left/right of previous/next one

I would like to code a function (macro or add-on) that allows to move a word left/right of previous/next one. I use such a macro in Word and would like to implement it in Studio.

Couyld someone help me ?

Regards

Arnaud