I’m not terribly big on microsoft products, but I have to use them at work. I was emailing someone whos reply-to address was incorrect, so I needed to rewrite it on send. It was terribly annoying to have to remember to replace it everytime I hit “reply.”
Here’s some code that does it.
123456789101112131415161718
PrivateSubApplication_ItemSend(ByValItemAsObject,CancelAsBoolean)'Trying to rewrite an email address on sendDimitem2AsMailItemIfTypeOfItemIsMailItemThenSetitem2=ItemDimstrAsStringDimrAsRecipientForEachrInitem2.RecipientsIfr.Address="old.address@someplace.net"Thenr.DeleteDimnewRecipientAsRecipientSetnewRecipient=item2.Recipients.Add("new.address@something.more.useful.com")newRecipient.Type=olTonewRecipient.ResolveEndIfNextEndIfEndSub