I prefer to use Notepad++ for writing scripts like these as it has good syntax highlighting. Create a vbscript file as outlook_signature.vbs
Store this file in a network share accessible by everyone. Get the company logo in a jpg format and store it in the same network share. You could use NETLOGON folder for which all users will have read access.
The following script will work for Outlook 2003 and above. Please note that if you are using Outlook 2000, the script needs to be changed.
———————-
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
objSelection.Style = “No Spacing”
Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
‘Name of Staff
objSelection.Font.Name = “Calibri”
objSelection.Font.Bold = True
objSelection.Font.Size = “12”
objSelection.Font.Color = RGB(15,36,62)
objSelection.TypeText strName
objSelection.TypeText(Chr(11))
‘Role of Staff
objSelection.Font.Name = “Calibri”
objSelection.Font.Bold = False
objSelection.Font.Size = “11”
objSelection.Font.Color = 0
objSelection.TypeText strTitle
objSelection.TypeText(Chr(11))
‘Company Logo (stored in network share accessed by everyone)
objSelection.InlineShapes.AddPicture(“\\servername\netlogon\signature.jpg”)
objSelection.TypeParagraph()
‘Company Contact details
objSelection.Font.Color = RGB(38,38,38)
objSelection.TypeText “Tel +44 (0) 744 525 5214”
objSelection.TypeText(Chr(11))
objSelection.TypeText “Fax +44 (0) 744 524 2244”
objSelection.TypeText(Chr(11))
objSelection.Font.Color = RGB(23,54,93)
objLink = objSelection.Hyperlinks.Add(objSelection.Range,“http://www.sujeeth.net/”,,“Sujeeth Home Page”,“www.sujeeth.net”)
objSelection.TypeParagraph()
objSelection.TypeParagraph()
‘environment message
objSelection.Font.Name = “Webdings”
objSelection.Font.Size = “14”
objSelection.Font.Color = RGB(115,155,63)
objSelection.TypeText “P “
objSelection.Font.Name = “Calibri”
objSelection.Font.Size = “9”
objSelection.TypeText “Please consider the environment before printing this e-mail.”
Set objSelection = objDoc.Range()
objSignatureEntries.Add “Standard Signature”, objSelection
objSignatureObject.NewMessageSignature = “Standard Signature”
objSignatureObject.ReplyMessageSignature = “Standard Signature”
objDoc.Saved = True
objWord.Quit
———————-
You can download the above script from pastebin
After you save the script in the network share, you can call this file from users’ Logon script or directly on the user machine using cscript
cscript \\servername\netlogon\outlook_signature.vbs
Once you run the script, check your Outlook if it has been properly setup. When you open a new email message, the signature should automatically append.
The signature files are usually stored in Application Data\Microsoft\Signatures folder
If you get problems with line spacing, use vbNewline instead of Chr(11)
You can check for Outlook 2000 version as following.
set outlook = createobject(“outlook.application”)
If outlook.version = “9.0.0.2711” or outlook.version = “9.0.0.3011” or outlook.version = “9.0.0.3821” or outlook.version = “9.0.0.4105” or outlook.version = “9.0.0.4201”
or outlook.version = “9.0.0.4527” or outlook.version = “9.0.0.5414” Then
Outlook2000 = True
End If