none
OutLook Signature

    Pergunta

  • Hello to all,

     

    I need to create an OutLook Add-in, this Add-in need to create a .html file in the location where the signature files are stored.

     

    Now my outlook addin create the file in the location.

     

    My question is, is posible programatically set as default OutLook signature my .html file?

     

    I apoligize my english.

     

    Best Regards.

     

    terça-feira, 15 de maio de 2007 17:37

Respostas

  • First, you need not just an .htm file, but also matching .txt and .rtf files with the same name.

     

    Once you have the necessary files, there are several possible approaches to setting the default signature. :

     

    1) For Office 2003 SP2 or later, set the NewSignature and ReplySignature string values in the HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings key to the name of the signature. (Office\12.0 for Outlook 2007, of course). I've heard reports, though, that this may not take effect until the user actually looks at the Signatures dialog in Outlook.

     

    2) Use a script like that at http://www.outlookcode.com/codedetail.aspx?id=821 to apply the signature to each account by hacking the Profiles section of the registry.

     

    3) Go through Word's EmailOptions.EmailSignature object, as discussed at http://www.microsoft.com/technet/technetmag/issues/2006/10/HeyScriptingGuy/. This technique works quite well in Outlook 2007. I'm not sure if it's 100% effective in Outlook 2003 if Word is not the email editor. Note that with this approach, you'd need to open your HTML file in Word in order to use it to set the signature.

     

    terça-feira, 15 de maio de 2007 19:44
    Moderador

Todas as Respostas

  • First, you need not just an .htm file, but also matching .txt and .rtf files with the same name.

     

    Once you have the necessary files, there are several possible approaches to setting the default signature. :

     

    1) For Office 2003 SP2 or later, set the NewSignature and ReplySignature string values in the HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings key to the name of the signature. (Office\12.0 for Outlook 2007, of course). I've heard reports, though, that this may not take effect until the user actually looks at the Signatures dialog in Outlook.

     

    2) Use a script like that at http://www.outlookcode.com/codedetail.aspx?id=821 to apply the signature to each account by hacking the Profiles section of the registry.

     

    3) Go through Word's EmailOptions.EmailSignature object, as discussed at http://www.microsoft.com/technet/technetmag/issues/2006/10/HeyScriptingGuy/. This technique works quite well in Outlook 2007. I'm not sure if it's 100% effective in Outlook 2003 if Word is not the email editor. Note that with this approach, you'd need to open your HTML file in Word in order to use it to set the signature.

     

    terça-feira, 15 de maio de 2007 19:44
    Moderador
  • Hello Sue Mosher,

     

     

    Thank you for your response, now I will read the 3th. option, I think this is my best option.

     

    Best Regards

    terça-feira, 15 de maio de 2007 21:30
  • Hi Sue,

     

    You are quite right that the 3rd option works great with O2K7. Finally a straight forward way of configuring Outlook signatures programmatically.

     

    I am working on a VSTO Addin for Outlook in which the users can design their signature by adding or removing certain elements such as direct phone, mobile phone, position etc. For this addin I would like to replace the "Signatures..." menu item of the built in SignatureInsertMenu with a menu item that launches my form with the options that are used to create new .htm, .rtf and .txt.

     

    Is it possible to remove the default "Signatures..." menu item and add a custom item.

     

    I might be able to set visibility of the SignatureInsertMenu to false and then add a button that launches my form, but then I will loose the menu items that enables the user to insert signatures in the mail item.

     

    Any ideas on how to get the desired behaviour?

     

    Thanks in advance.

     

    Finn

    quinta-feira, 21 de junho de 2007 21:18
  • That would require working with the ribbon interface, which is not my area of expertise. I'd suggest that you read the MSDN articles on the subject and, if the samples don't give you what you need, start a new discussion thread.
    quinta-feira, 21 de junho de 2007 21:54
    Moderador
  •  

    Hi Sue

     

    I used the second example and it helped me a lot.

    Many thanks

     

    I'm now wondering if I can reset, by script, the signature option within a new email window.

    It populates when you choose a new signature but how can I change it to the signature I've forced with the previous script without obliging the user to first select it form the "More..." option?

     

    The key seems to be this:

     

    HKCUSoftware\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\DefaultProfile\0a0d020000000000c000000000000046\101f035c

     

    but the way it is generated is not really clear and the ByteArray contains some other data.

     

    Many thanks for your help.

    quarta-feira, 16 de janeiro de 2008 19:27
  • Gianfri, I don't know what that particular setting for the mail profile does or how it's structured. I'd stay away from it.

    Also, I'm not sure what you mean by "reset the signature option." If you're interested in setting the per-account default signature for accounts in the current mail profile, I wrote a WMI routine to change it -- see http://www.outlookcode.com/codedetail.aspx?id=821 -- but haven't bothered to convert it to VB.NET.
    quarta-feira, 16 de janeiro de 2008 19:38
    Moderador
  • I already implemented your routine, it is perfect.

    But there is another signature option, which is the one you find while writing a new email and you click on the signature icon, "the one with the writing hand" which shows you the recent used signature + a "More..." option.

    I wanted to force this recent list to be updated with the new signature file.
    quarta-feira, 16 de janeiro de 2008 22:52
  • That list isn't customizable. Outlook controls it internally.
    quarta-feira, 16 de janeiro de 2008 23:08
    Moderador