|
JP2006 -> RE: Automate E-Mail Signatures (Exchange 2007/Outlook) (16.Apr.2009 2:18:49 AM)
|
That's okey [:)] Yes the website will be "clickable", but you can also edit the colour [:)] Edit: This should work: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ On Error Resume Next Set objSysInfo = CreateObject("ADSystemInfo") strUser = objSysInfo.UserName Set objUser = GetObject("LDAP://" & strUser) strName = objUser.FullName strFirstName = objuser.givenName StrLastName = objuser.sn strTitle = objUser.Title strDepartment = objUser.Department strCompany = objUser.Company strAddress = objuser.streetAddress strCity = objuser.l strState = objuser.st strZip = objuser.postalCode strPhone = objUser.telephoneNumber strFax = objUser.FaxNumber strMobilePhone = objUser.mobile strMail = objuser.mail strLocation = objuser.physicalDeliveryOfficeName strWeb = objuser.wWWHomePage Set objWord = CreateObject("Word.Application") objWord.Visible = False Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection Set objRange = objDoc.Range() Set objEmailOptions = objWord.EmailOptions Set objSignatureObject = objEmailOptions.EmailSignature Set objSignatureEntries = objSignatureObject.EmailSignatureEntries objSelection.Font.Size = "11" objSelection.Font.Name = "book antique" objSelection.Font.Color = "&hFF0000" objSelection.Font.Bold = True objSelection.TypeText strFirstName & " " & strLastName objSelection.TypeParagraph() objSelection.Font.Size = "10" objSelection.Font.Bold = False objSelection.TypeText strTitle objSelection.TypeText(Chr(11)) objSelection.TypeText strCompany objSelection.TypeText(Chr(11)) objSelection.TypeText "Phone: " & strPhone objSelection.TypeText(Chr(11)) objSelection.TypeText "Mobile: " & strMobilePhone objSelection.TypeText(Chr(11)) objSelection.TypeText "Fax: " & strFax objSelection.TypeText(Chr(11)) objSelection.Font.Color = "&hFF" objSelection.TypeText strWeb objSelection.TypeText(Chr(11)) objSelection.Font.Color = "&hFF0000" objSelection.TypeParagraph() objSelection.Font.Size = "11" objSelection.Font.Name = "book antique" objSelection.Font.Color = "&hFF0000" objSelection.Font.Bold = True objSelection.Font.Italic = True objSelection.TypeText "We'll take it from here..." objSelection.range, "mailto:" & strMail, , , strMail objSelection.range, strWeb, , , strCompany objTable.Columns(1).Width = objWord.InchesToPoints(5) objSignatureEntries.Add "Signature", objRange objSignatureObject.NewMessageSignature = "Signature" objSignatureObject.ReplyMessageSignature = "Signature" objDoc.Saved = True objWord.Quit :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: JP2006 System Administrator Company Phone: +31 (0)************* Mobile: 06 **** Fax: +31 ********* www.website.nl We'll take it from here... (In your signature, all the text is blue but the 'www.website.nl' text is red) You can now just copy and paste this in a notepad document and save it as 'signature.vbs' ... If you now open this file (or call it with a loginscript) EDIT2: You can also use your logo, if you've got a smaller one somewhere :P: On Error Resume Next Set objSysInfo = CreateObject("ADSystemInfo") strUser = objSysInfo.UserName Set objUser = GetObject("LDAP://" & strUser) strName = objUser.FullName strFirstName = objuser.givenName StrLastName = objuser.sn strTitle = objUser.Title strDepartment = objUser.Department strCompany = objUser.Company strAddress = objuser.streetAddress strCity = objuser.l strState = objuser.st strZip = objuser.postalCode strPhone = objUser.telephoneNumber strFax = objUser.FaxNumber strMobilePhone = objUser.mobile strMail = objuser.mail strLocation = objuser.physicalDeliveryOfficeName strWeb = objuser.wWWHomePage strLogo = "http://www.kgllogistics.com/Images/1.gif" Set objWord = CreateObject("Word.Application") objWord.Visible = False Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection Set objRange = objDoc.Range() Set objEmailOptions = objWord.EmailOptions Set objSignatureObject = objEmailOptions.EmailSignature Set objSignatureEntries = objSignatureObject.EmailSignatureEntries objSelection.Font.Size = "11" objSelection.Font.Name = "book antique" objSelection.Font.Color = "&hFF0000" objSelection.Font.Bold = True objSelection.TypeText strFirstName & " " & strLastName objSelection.TypeParagraph() objSelection.Font.Size = "10" objSelection.Font.Bold = False objSelection.TypeText strTitle objSelection.TypeText(Chr(11)) objSelection.TypeText strCompany objSelection.TypeText(Chr(11)) objSelection.TypeText "Phone: " & strPhone objSelection.TypeText(Chr(11)) objSelection.TypeText "Mobile: " & strMobilePhone objSelection.TypeText(Chr(11)) objSelection.TypeText "Fax: " & strFax objSelection.TypeText(Chr(11)) objSelection.Font.Color = "&hFF" objSelection.TypeText strWeb objSelection.TypeText(Chr(11)) objSelection.Font.Color = "&hFF0000" objSelection.TypeParagraph() objSelection.Font.Size = "11" objSelection.Font.Name = "book antique" objSelection.Font.Color = "&hFF0000" objSelection.Font.Bold = True objSelection.Font.Italic = True objSelection.TypeText "We'll take it from here..." objSelection.TypeText(Chr(11)) objShape = objSelection.InlineShapes.AddPicture(strLogo) objSelection.range, "mailto:" & strMail, , , strMail objSelection.range, strWeb, , , strCompany objTable.Columns(1).Width = objWord.InchesToPoints(5) objSignatureEntries.Add "Signature", objRange objSignatureObject.NewMessageSignature = "Signature" objSignatureObject.ReplyMessageSignature = "Signature" objDoc.Saved = True objWord.Quit ----------------------------------- Now your company logo is beneath your signature [8D] You can edit the logo-path with this part: strLogo = "http://www.kgllogistics.com/Images/1.gif" and if you change this part of the script: objSignatureObject.NewMessageSignature = "Signature" objSignatureObject.ReplyMessageSignature = "Signature" you can edit the way the signature will be added (for example; if you don't want the signature to be added when you replay a message, you change it to this: objSignatureObject.NewMessageSignature = "Signature" objSignatureObject.ReplyMessageSignature = "None"
|
|
|
|