Copy Title block Attributes to clipboard then relink to custom properties and paste into custom properties

We have quite a bit of drawings that the user erased the links within the Title-block to custom properties and typed the text there instead. I need to copy the text that is there, relink the attribute to the custom property and then paste the value back to the custom property.

I have macro that will change custom properties for me but I am having trouble copying the text from the attributes.

Has anyone done this before with a Macro?

SolidworksApi macros