The code needs to go behind your VB form not in Outlook VBA.