VB Script for Email Signature Resolution adjustment
-
Thursday, February 14, 2013 2:52 PM
Hi Scripting Guy,
I have a VB script that I rolled out on the domain through GPO. On outlook 2003 it looks perfect but when I send a mail and it is opened by outlook 2007 and above the icons are in a different place and the ones rolled out on outlook 2010 looks slightly different.
I believe that this is maybe a resolution that doesn't adjust to the other user's resolution.... This is my script and I don't know if there is a command that specify for everything to fit to that resolution. Even if you zoom in and out it messes up the small icons a bit.
Here is my script:On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strName = objUser.FullName
strCompany = objUser.Company
strTitle = objUser.Title
'strDepartment = objUser.Department
strPhone = objUser.telephoneNumber
strFax = objUser.faxnumber
strMobile = objUser.mobile
strEmail = objUser.emailaddress
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 = "11"
objSelection.Font.Color = RGB(0,0,0)
objSelection.TypeText strName
objSelection.TypeText(Chr(11))
'Role of Staff
objSelection.Font.Name = "Calibri"
objSelection.Font.Bold = True
objSelection.Font.Size = "11"
objSelection.Font.Color = RGB(173,152,65)
objSelection.TypeText strTitle
objSelection.TypeText(Chr(11))
objSelection.TypeText(Chr(11))
objSelection.Font.Name = "Calibri"
objSelection.Font.Bold = True
objSelection.Font.Size = "11"
objSelection.Font.Color = RGB(0,0,0)
objSelection.TypeText "Some information"
objSelection.TypeText(Chr(11))
objSelection.Font.Name = "Calibri"
objSelection.Font.Bold = False
objSelection.Font.Size = "11"
objSelection.Font.Color = RGB(0,0,0)
objSelection.TypeText "More information re my company"
objSelection.TypeText(Chr(11))
objSelection.Font.Name = "Calibri"
objSelection.Font.Bold = False
objSelection.Font.Size = "11"
objSelection.Font.Color = RGB(0,0,0)
objSelection.TypeText "Tel: " & strPhone & " | " & "Fax: " & strFax & " | " & "Cell: " & strMobile
objSelection.TypeText(Chr(11))
objLink = objSelection.Hyperlinks.Add(objSelection.Range,"website link",,, "name of link","_Blank")
objSelection.TypeText " "
objSelection.InlineShapes.AddPicture("\\server\NETLOGON\signatures\Facebook.gif")
With (objDoc)
objDoc.Hyperlinks.Add objDoc.InlineShapes.Item(1), "https://www.facebook.com"
End With
objSelection.TypeText " "
objSelection.InlineShapes.AddPicture("\\server\NETLOGON\signatures\Twitter.gif")
With (objDoc)
objDoc.Hyperlinks.Add objDoc.InlineShapes.Item(2), "https://www.twitter.com"
End With
objSelection.TypeText " "
objSelection.InlineShapes.AddPicture("\\server\NETLOGON\signatures\Tripadvisor.gif")
With (objDoc)
objDoc.Hyperlinks.Add objDoc.InlineShapes.Item(3), "www.tripadvisor.com"
End With
objSelection.TypeText(Chr(11))
'Company Logo (stored in network share accessed by everyone)
objSelection.InlineShapes.AddPicture("\\server\NETLOGON\signatures\My main signature banner.gif")
With (objDoc)
objDoc.Hyperlinks.Add objDoc.InlineShapes.Item(4), "link if you click on the banner"
End With
objSelection.TypeText(Chr(11))
'objSelection.TypeParagraph()
'objSelection.TypeText " "
objSelection.Hyperlinks.Add objSelection.Range, "1",,, "Home","_Blank"
objSelection.TypeText " | "
objSelection.Hyperlinks.Add objSelection.Range, "2",,, "2","_Blank"
objSelection.TypeText " | "
objSelection.Hyperlinks.Add objSelection.Range, "3",,, "3","_Blank"
objSelection.TypeText " | "
objSelection.Hyperlinks.Add objSelection.Range, "5",,, "4","_Blank"
objSelection.TypeText " | "
objSelection.Hyperlinks.Add objSelection.Range, "5",,, "5","_Blank"
objSelection.TypeText " | "
objSelection.Hyperlinks.Add objSelection.Range, "6",,, "6","_Blank"
objSelection.TypeText " "
objSelection.TypeText(Chr(11))
'environment message or something
'objSelection.Font.Name = "Webdings"
'objSelection.Font.Size = "8"
'objSelection.Font.Color = RGB(115,155,63)
'objSelection.TypeText ""
'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 "AHS", objSelection
objSignatureObject.NewMessageSignature = "sig_name"
objSignatureObject.ReplyMessageSignature = "sig_name"
objSignatureObject.ForwardMessageSignature = "sig_name"
objDoc.Saved = True
objWord.QuitThank you in advance!
Regards Jay
All Replies
-
Thursday, February 14, 2013 2:59 PM
Please post questions like this in the Outlook forums. This is a product specific issue and not a scripting issue.
¯\_(ツ)_/¯
-
Thursday, February 14, 2013 3:11 PM
Sorry jrv, I'm new here and will do that.
Thanks.
-
Thursday, February 14, 2013 3:18 PMSorry for being such a noob, but where exactly is this outlook section?
-
Thursday, February 14, 2013 3:20 PMModerator
You might try a search for "outlook forum" or "outlook for developers forum".
Bill
-
Thursday, February 14, 2013 3:25 PMThank you Bill :)
-
Thursday, February 14, 2013 3:33 PM
I can't get it right to find an Outlook scripting forum here to post my question...
Ignore this post, I will try other support sites then :( maybe it will be easier
Have a great day!
Jason
-
Thursday, February 14, 2013 3:40 PM
First search - first line returned:
http://social.technet.microsoft.com/Forums/en-AU/outlook/threads
Learn to use your search capabilities. It will save you a lot of frustration.
¯\_(ツ)_/¯
-
Thursday, February 14, 2013 3:42 PM
Sorry - here is US forum:
http://social.technet.microsoft.com/Forums/en-US/outlook/threads
¯\_(ツ)_/¯
- Marked As Answer by Bill_StewartMicrosoft Community Contributor, Moderator Tuesday, March 19, 2013 7:14 PM

