Hi there. I am using the following script to create an email signature, but
I need to change font, use bold and italic and change font color for
different lines as well as pull in a JPG image.

Any help would be greatly appreciated.

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
strEmail = objUser.mail

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.TypeText strName
objSelection.TypeParagraph()
objSelection.TypeText strTitle
objSelection.TypeParagraph()
objSelection.TypeText strEmail
objSelection.TypeParagraph()
objSelection.TypeText strCompany
objSelection.TypeParagraph()
objSelection.TypeText strPhone

Set objSelection = objDoc.Range()

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

objDoc.Saved = True
objWord.Quit

Re: Email Signature Customization by mayayana

mayayana
Mon Mar 10 14:09:39 CDT 2008

When I want to send a custom HTML email
I usually start one in Outlook Express, then
save it as a file, then edit the HTML by hand
and import it back into OE. You might be
able to do a similar thing in Word, and maybe
use a hand-done sample as your code template.

I think you'll find it quite tedious, though. If you
look at the HTML code generated in a Word email
you'll see that it's astoundingly bloated and full
of nonsense HTML tags starting with "MSO", which
only make sense to Word.

> Hi there. I am using the following script to create an email signature,
but
> I need to change font, use bold and italic and change font color for
> different lines as well as pull in a JPG image.
>
> Any help would be greatly appreciated.
>
> 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
> strEmail = objUser.mail
>
> 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.TypeText strName
> objSelection.TypeParagraph()
> objSelection.TypeText strTitle
> objSelection.TypeParagraph()
> objSelection.TypeText strEmail
> objSelection.TypeParagraph()
> objSelection.TypeText strCompany
> objSelection.TypeParagraph()
> objSelection.TypeText strPhone
>
> Set objSelection = objDoc.Range()
>
> objSignatureEntries.Add "AD Signature", objSelection
> objSignatureObject.NewMessageSignature = "AD Signature"
> objSignatureObject.ReplyMessageSignature = "AD Signature"
>
> objDoc.Saved = True
> objWord.Quit
>
>