i made something to generate the signatures for users, but now i would also like to set it as default signature. this will it will be automaticly added to new emails you are writing or answering.
i have not been able to find any kind of example or reference to how i could do this. Can someone point me in the right direction please.
I find it more easy to set the signatures through the VSTO Word object:
static void SetDefault(string signature)
{
Word.Application oWord = new Word.Application();
Word.EmailOptions oOptions;
oOptions = oWord.Application.EmailOptions;
oOptions.EmailSignature.NewMessageSignature = signature;
oOptions.EmailSignature.ReplyMessageSignature = signature;
//Release Word
if (oOptions != null) System.Runtime.InteropServices.Marshal.ReleaseComObject(oOptions);
if (oWord != null) System.Runtime.InteropServices.Marshal.ReleaseComObject(oWord);
}
Found a way to do this with a registry key. the key is located at HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows messaging Subsystem\Profiles[OutlookProfilename]\9375CFF0413111d3B88A00104B2A6676
in that key there will me mutitple folder 00000001 going up, for each signature one. if you delete someone's windows profile the count starts at 1 again.
in here if you place a REG_Binary named
"New Signature" or "Reply-Forward Signature"
the value should be the name of the signature in hex format.
Say the signatures name is Test it would become
54 65 73 74 in hex. the reg key would like it like this:
54006500730074000000000000000000000000
i hope i made myself clear like this :D it wasnt easy finding this :D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With