Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '*****************************************
- ' Script to set signature using Active
- ' Directory fields.
- ' Only works when connected to Active
- ' Directory
- '
- ' Written By: Steve Chambers
- ' Date: 13/09/07
- '
- '*****************************************
- 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
- strFax = objUser.Faxnumber
- strstreetAddress = objUser.streetAddress
- strl = objUser.l
- strst = objUser.st
- strpostalCode = objUser.postalCode
- strmail = objUser.mail
- strwWWHomePage = objUser.wWWHomePage
- 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 = "16"
- objSelection.TypeText strName
- objSelection.TypeParagraph()
- objSelection.Font.Size = "12"
- objSelection.TypeText strTitle
- objSelection.TypeParagraph()
- objSelection.TypeParagraph()
- objSelection.TypeText strCompany
- objSelection.TypeParagraph()
- objSelection.TypeText strstreetAddress
- objSelection.TypeParagraph()
- objSelection.TypeText strl
- objSelection.TypeParagraph()
- objSelection.TypeText strst
- objSelection.TypeText ", "
- objSelection.TypeText strpostalCode
- objSelection.TypeParagraph()
- objSelection.TypeParagraph()
- objSelection.TypeText "T: "
- objSelection.TypeText strPhone
- objSelection.TypeParagraph()
- objSelection.TypeText "F: "
- objSelection.TypeText strFax
- objSelection.TypeParagraph()
- objSelection.TypeText "E: "
- objSelection.TypeText strmail
- objSelection.TypeParagraph()
- objSelection.TypeText "I: "
- objSelection.TypeText strwWWHomePage
- objSelection.TypeParagraph()
- objSelection.TypeParagraph()
- Set objShape = objSelection.InlineShapes.AddPicture("\\sjsj-fs01\sjsj_data$\Intranet\Achtergrond_e-mailhandtekening.jpg")
- objSelection.TypeParagraph()
- objSelection.TypeParagraph()
- objSelection.Font.Size = "10"
- objSelection.TypeText " "
- Set objSelection = objDoc.Range()
- objSignatureEntries.Add "AD Signature", objSelection
- objSignatureObject.NewMessageSignature = "AD Signature"
- objSignatureObject.ReplyMessageSignature = "AD Signature"
- objDoc.Saved = True
- objWord.Quit
Advertisement
Add Comment
Please, Sign In to add comment