Creating a standard company email signature for outlook 2003

Find this post interesting? Do you like interesting things? Maybe you would like my invention, a connectible candle called a WickBrick!

Get one here


So got the word that we wanted to roll out a standard email company sig, so I started sniffing around for my options. Of course there are a bunch of options that you could pay for, but I don’t like to pay for things if I don’t have to.

Luckily, the Microsoft scripting guys came to the rescue with this article.

The magic is to pull the info from AD with a script and then create an word email signature.

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

strName = objUser.FullName
strTitle = objUser.Title
strDepartment = objUser.Department
strCompany = objUser.Company
strPhone = objUser.telephoneNumber

Set objWord = CreateObject("Word.Application")

Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection

Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature

Set objSignatureEntries = objSignatureObject.EmailSignatureEntries

objSelection.TypeText strName & ", " & strTitle
objSelection.TypeText strDepartment
objSelection.TypeText strCompany
objSelection.TypeText strPhone

Set objSelection = objDoc.Range()

objSignatureEntries.Add "AD Signature", objSelection
objSignatureObject.NewMessageSignature = "AD Signature"
objSignatureObject.ReplyMessageSignature = "AD Signature"

objDoc.Saved = True

So that is pretty cool, and gives the structure of how to create the signature.

After rolling it out though if a user was not using word as their email editor it would always double space the signature. It makes sense in that the html tag that is used is adding an extra space. FYI if you are creating sig by hand than you should use a shift+enter and then of your lines to avoid this, a so called ‘soft enter’.

So I modified the script to use

objSelection.TypeText(Chr(11)) instead of 
objSelection.TypeParagraph() thus stopping the annoying double space issue.

Next push this out to the AD with logon scripts to various groups and there you go, standard email signatures.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s