home | get Sue’s code | forums | share code | registration

More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

Login

login
password
Remember me

You will need to register and log in if you want to download the source code for the Microsoft Outlook Programming book. The forums and code sharing areas are open to both registered and non-registered visitors.

share code 09-Feb-2010 11:13

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

 

Code level: advanced    Code area: Outlook Expert Techniques Printer Friendly Version
Title: Set email account signature in Outlook 2003
Description: Outlook 2003 makes it particularly difficult to set the signature for new messages and replies/forwards because each mail account has its own signature. This sample script uses the Windows Management Instrumentation (WMI) interface and something of a "brute force" approach to set a signature on all services, even those that aren't email accounts.
Date: 30-Mar-2005  02:10
Code level: advanced
Code area: Outlook Expert Techniques
Posted by: Sue Mosher
Body:
All 95comments
Page [ 1 2 3 4 5 6 7 8 9 10 Next >>  
  30-Mar-2005  10:16   
NOTES:

1) This technique is officially unsupported. The only supported methods for modifying profile settings are Extended MAPI programming (which can't be scripted) and .prf files, which can't dig deeply enough into the profile settings to set signatures.

2) This sample sets both the new and reply/forward signatures. You might want to modify it to change only one or the other.

For a good introduction to WMI scripting, see http://msdn.microsoft.com/library/en-us/dnclinic/html/scripting06112002.asp

For another WMI script to set the Outlook Address Book display order to Last, First, see http://www.outlookcode.com/codedetail.aspx?id=804
  08-Apr-2005  11:50   
Don't forget to change "Signature Name" to the actual name of the signature you want or "" if you want no signature.
  14-Apr-2005  11:27   
Sue, how can you set it so that if there is no Outlook profile that it will just exit out of the script and not error out.
  15-Apr-2005  08:04   
You mean if the user has never run Outlook at all? I guess that after the first If strProfile = "" block, you could add another:

If strProfile = "" Then
    Exit Sub
End If
  01-Jun-2005  13:50   
The KB article at http://support.microsoft.com/?kbid=898076 describes a post SP1 hotfix for Outlook and Word 2003. If you apply it, delete the First-Run value as described in the article, and then set NewSignature and ReplySignature REG_SZ (string) values in the HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\11.0\Common\MailSettings key to the name of the desired signature, that signature will be the default for all accounts, and the user won't be able to change that default.
  17-Jun-2005  21:26   
Is there a way to modify this code to automatically cycle through all the available signatures?
  01-Jul-2005  11:32   
Stuart, all the available signatures would be stored as filed in the user's Signatures folder, if that's what you're asking.
  14-Sep-2005  08:13   
Note that this script is from my book, "Configuration Microsoft Outlook 2003." You can get more information on the book at http://www.turtleflock.com/olconfig/index.htm
  17-Oct-2005  11:49   
The fix mentioned in my 01-Jun-2005 post has been incorporated into Office 2003 Service Pack 2 (SP2).
  30-Nov-2005  07:17   
Hi the script works great. I don't have a lot of scripting knowledge but my company wants the first and lastname and department of the user in the signature as well. Is this posible? Is there a way to retreive this with LDAP from the AD?
Page [ 1 2 3 4 5 6 7 8 9 10 Next >>  
Post your comment



name        email