Sometimes when sending a new event invitation for a certain meeting in Outlook I need to mention all the required people for the meeting in the invitation body, due to company conventions. Many times, the names I already sent the invitation to are the very same people I need to write all over again. I found that if I copy those names from the "To..." field, they are pasted in the format of name <mail>; name <mail>; name <mail>
, so I wrote this Python function to turn it into a plain list of names separated by a new line with the mail addresses removed:
def format_invitees(string):
import re; return ''.join(x.strip(' \n')+'\n' for x in re.sub("[<].*?[>]", "", string).replace(' ; ', ';').split(';')).strip('\n')
Now, is there any good way to implement this function into an Outlook Macro, with whether to assign it to a hotkey or add it to the menu on right click? To mention that Python is the only language I know, and I am not allowed to install any external software due to organization orders. Best regards!