M
Matt
Hi all,
I have a little VBS script that runs from a GPO as part of the user's login
processing that automatically creates an Outlook signature based on
information extracted from their Active Directory account. The script itself
works fine and gives me entirely the expected results, except for two
things:
o The company logo is referenced from an external web site and placed
as the *very first* item on the signature, but when used in a new mail
message, two line spaces appear immediately above it. This happens across
every machine I have tested it on.
o When the spell checker is invoked, a nice little box pops up that
says "The spelling and grammar check is complete. Text marked with 'Do not
check spelling or grammar' was skipped". After examining the formatting
style of the paragraph, I note that "Do not check spelling or grammer" is
'half ticked' on the Language settings. By 'half ticked' I mean the grey
tick which indicates it inherits the setting from somewhere else. I've
pulled my hair out trying to clear this tick box programmatically but have
been unsuccessful.
Any assistance is most gratefully received!
For reference, here's the VBS script I'm using:
I have a little VBS script that runs from a GPO as part of the user's login
processing that automatically creates an Outlook signature based on
information extracted from their Active Directory account. The script itself
works fine and gives me entirely the expected results, except for two
things:
o The company logo is referenced from an external web site and placed
as the *very first* item on the signature, but when used in a new mail
message, two line spaces appear immediately above it. This happens across
every machine I have tested it on.
o When the spell checker is invoked, a nice little box pops up that
says "The spelling and grammar check is complete. Text marked with 'Do not
check spelling or grammar' was skipped". After examining the formatting
style of the paragraph, I note that "Do not check spelling or grammer" is
'half ticked' on the Language settings. By 'half ticked' I mean the grey
tick which indicates it inherits the setting from somewhere else. I've
pulled my hair out trying to clear this tick box programmatically but have
been unsuccessful.
Any assistance is most gratefully received!
For reference, here's the VBS script I'm using:
Code:
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.emailAddress
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
'
' Here I set style, override the font settings and explicitly clear the
NoProofing setting
'
objSelection.Style = "Normal"
objSelection.Font.Name = "Verdana"
objSelection.Font.Size = 9
objSelection.NoProofing = False
'
' Here is where the image gets inserted - note nothing inserted before it
'
objSelection.InlineShapes.AddPicture "http://www.website.com/image.gif"
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeText "Kind regards, "
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.Font.Bold = true
objSelection.TypeText strName
objSelection.Font.Bold = false
objSelection.TypeParagraph()
objSelection.Font.Italic = true
objSelection.TypeText strTitle
objSelection.Font.Italic = false
objSelection.TypeParagraph()
objSelection.TypeParagraph()
objSelection.TypeText strCompany
objSelection.TypeParagraph()
Set objSelection = objDoc.Range()
objSignatureEntries.Add "AD Signature", objSelection
objSignatureObject.NewMessageSignature = "AD Signature"
objSignatureObject.ReplyMessageSignature = "AD Signature"
objDoc.Saved = True
objWord.Quit