Is there any function to do this? VBA

Hello! I am creating a macro in which I need to implement the following.
Is there any function or instruction that, let's say, compress letters (curves) to one strip? Just like in the screenshot.
Or are there any ideas how this can be implemented?