• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Outlook Signature Hyperlink - VB script querying AD

TopDog

Weaksauce
Joined
Jun 3, 2004
Messages
81
So I've set up a VB script to query AD and generate an Outlook signature.
Is anyone able to tell me how I can make the www.webpage.com hyperlink the following style: Verdana/Bold/sz9/RGB(0,112,192) just like the trading name text, rather than the default font and style used for hyperlinks.

I really have no idea what I'm doing here, I've been completely winging this.

Here's a what I’m getting at the moment:
Outlook-Sig.jpg



Heres a copy of the script:

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)

strName = objUser.FullName
strTitle = objUser.description
strPhone = objUser.ipPhone
strEmail = objUser.emailaddress
strMobile = objUser.mobile
strFax = objUser.facsimileTelephoneNumber


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


'Company Logo
objSelection.InlineShapes.AddPicture("\\DOMAIN-NAME-HERE\netlogon\email-signiture-logo.jpg")
objSelection.TypeParagraph()
objSelection.TypeParagraph()

'Display Name
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = True
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(0,112,192)
objSelection.TypeText strName
objSelection.TypeText(Chr(11))

'Description
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = False
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(77,77,77)
objSelection.TypeText strTitle
objSelection.TypeText(Chr(11))
objSelection.TypeParagraph()
objSelection.TypeParagraph()

'Trading Name
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = True
objSelection.Font.Size = "9"
objSelection.Font.Color = RGB(0,112,192)
objSelection.TypeText "TRADING NAME"
objSelection.TypeParagraph()
objSelection.TypeParagraph()

'T:
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = True
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(146,208,80)
objSelection.TypeText "T: "

'IP Phone
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = False
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(77,77,77)
objSelection.TypeText strPhone
objSelection.TypeParagraph()

'F:
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = True
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(146,208,80)
objSelection.TypeText "F: "

'Fax
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = False
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(77,77,77)
objSelection.TypeText strFax
objSelection.TypeParagraph()

'M:
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = True
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(146,208,80)
objSelection.TypeText "M: "

'Mobile
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = False
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(77,77,77)
objSelection.TypeText strMobile
objSelection.TypeParagraph()

'E:
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = True
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(146,208,80)
objSelection.TypeText "E: "

'Email
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = False
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(77,77,77)
objLink = objSelection.Hyperlinks.Add(objSelection.Range,"mailto:" & stremail & " ", , , stremail)
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeParagraph()

'Slogan
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = False
objSelection.Font.Italic = True
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(77,77,77)
objSelection.TypeText "slogan here"
objSelection.TypeParagraph()

'URL
objSelection.Font.Name = "Verdana"
objSelection.Font.Bold = True
objSelection.Font.Size = "9.5"
objSelection.Font.Color = RGB(0,112,192)
objLink = objSelection.Hyperlinks.Add(objSelection.Range,"http://www.webpage.com",,"Our Webpage", "www.webpage.com")



Set objSelection = objDoc.Range()

objSignatureEntries.Add "Standard Signature", objSelection
objSignatureObject.NewMessageSignature = "Standard Signature"
objSignatureObject.ReplyMessageSignature = "Standard Signature"

objDoc.Saved = True
objWord.Quit
 
Does this script run at logon or something? I've been wanting to have automatic signatures for a long time (IE, if I want to change everyone's layout I can do it in one spot... Or if we want to change a disclaimer or something).
 
That's the plan however at the moment I'm just executing the file manually.

Anyone with any ideas?
 
The script seems to be working fine, really just the issue with the hyperlink text style.

RiDDLeRThC that product looks good, if only my company would fork out for it.
 
TopDog,
No idea I'm not a VB guy. But I've adapted it to my org and I love it... Except for two things
1) Tables (I want the company logo to the right of the user's info)...
2) People using Outlook over HTTP- this info won't pull.
 
Back
Top