I downloaded a script in an effort to force a default Outlook signature for our entire company that would pull information from AD. It appears to work halfway where it will insert my name and company logo and address, but the rest of the info displays the variable identifier and not the actual AD info. Is there someone who can point out any obvious errors to me because I have ZERO scripting experience.
Thanks.
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set WshShell = CreateObject("WScript.Shell")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strName = objUser.FullName
strTitle = objUser.Description
strCred = objUser.info
strStreet = objUser.StreetAddress
strLocation = objUser.l
strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail
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.Font.Name = "Arial"
objSelection.Font.Size = 14
objSelection.Font.Bold = true
objSelection.Font.Color = RGB(0,34,102)
if (strCred) Then objSelection.TypeText strName & ", " & strCred Else objSelection.TypeText strName
objSelection.TypeText Chr(11)
objSelection.Font.Size = 11
objSelection.Font.Bold = false
objSelection.Font.Color = RGB(0,0,0)
objSelection.TypeText strTitle
objSelection.TypeText Chr(11)
objselection.TypeText Chr(11)
objSelection.InlineShapes.AddPicture("\\xxxxx.com\SYSVOL\xxxxx.COM\scripts\tg_logo.jpg")
objSelection.TypeParagraph()
objSelection.Font.Size = 12
objSelection.Font.Bold = true
objSelection.Font.Color = RGB(75,75,75)
objSelection.TypeText "North America - Europe - Asia"
objSelection.TypeText Chr(11)
objSelection.Font.Size = 11
objSelection.Font.Color = RGB(0,0,0)
objSelection.Font.Bold = false
objSelection.TypeText strStreet
objSelection.TypeText Chr(11)
objSelection.TypeText strLocation
objSelection.TypeText Chr(11)
objSelection.TypeText PostCode
objSelection.TypeText Chr(11)
objSelection.TypeText "Phone: " & strPhone
objSelection.TypeText Chr(11)
if (strFax) Then objSelection.TypeText "FAX: " & strFax & Chr(11)
if (strMobile) Then objSelection.TypeText "Mobile: " & strMobile & Chr(11)
objSelection.Font.Italic = true
objSelection.TypeText "email: " & strEmail
objSelection.Font.Italic = false
objSelection.TypeText Chr(11)
objSelection.TypeText "________________________________"
objSelection.TypeText Chr(11)
objSelection.TypeText "CONFIDENTIALITY NOTICE"
Set objSelection = objDoc.Range()
objSignatureEntries.Add "Full Signature", objSelection
objSignatureObject.NewMessageSignature = "Full Signature"
objDoc.Saved = True
objWord.Quit
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.Font.Name = "Arial"
objSelection.Font.Size = 10
if (strCred) Then objSelection.TypeText strName & ", " & strCred Else objSelection.TypeText strName
objSelection.TypeParagraph()
objSelection.TypeText strTitle
objSelection.TypeText Chr(11)
Set objSelection = objDoc.Range()
objSignatureEntries.Add "Reply Signature", objSelection
objSignatureObject.ReplyMessageSignature = "Reply Signature"
objDoc.Saved = True
objWord.Quit