rckollar
asked on
How do I change the Font Color with VB
I wrote a VB Script that creates an MS Outlook Signature; pulling data from Active Directory. I want to have the company name show as RED, and the rest of the signature show as black.
When I put ObjSelection.Font.Color = "192,039,045" or objSelection.Font.Color = "000,000,000" above/below the company name, either the entire signature is black or everything below the company name is RED.
Here is the format of the signature:
Logo
Name / Title
Company Name
Address
Phone
Fax
URL
When I put ObjSelection.Font.Color = "192,039,045" or objSelection.Font.Color = "000,000,000" above/below the company name, either the entire signature is black or everything below the company name is RED.
Here is the format of the signature:
Logo
Name / Title
Company Name
Address
Phone
Fax
URL
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strName = objUser.FullName
strTitle = objUser.Title
strCompany = objUser.Company
strPhone = objUser.telephoneNumber
strMobile = objUser.mobile
strFax = objUser.faxNumber
strEmail = objUser.emailAddress
strStreet = objUser.streetAddress
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.InlineShapes.AddPicture("c:\downloads\INDS_SIGNATURE.jpg")
objSelection.TypeParagraph()
objSelection.Font.Name = "Tahoma"
objSelection.Font.Size = "8"
objSelection.Font.Bold = true
objSelection.TypeText strName & " / " & strTitle
objSelection.TypeParagraph()
objSelection.Font.Bold = true
objSelection.Font.Size = "8"
objSelection.Font.Color = "192,039,045"
objSelection.TypeText strCompany
objSelection.Font.Color = "000,000,000"
objSelection.Font.Size = "7"
objSelection.TypeParagraph()
objSelection.Font.Bold = false
objSelection.TypeText strStreet
objSelection.TypeParagraph()
objSelection.TypeText "Phone: " & " 800-942-0400 / 516-228-8600 " & strPhone
objSelection.TypeParagraph()
objSelection.TypeText "Fax: " & strFax
objSelection.TypeParagraph()
objSelection.TypeText "www.inds.com"
objSelection.TypeParagraph()
Set objSelection = objDoc.Range()
objSignatureEntries.Add "AD Signature", objSelection
objSignatureObject.NewMessageSignature = "AD Signature"
objSignatureObject.ReplyMessageSignature = "AD Signature"
objDoc.Saved = True
objWord.Quit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.