views:

9

answers:

1

I have a login script that checks for a registry key and if the key is not found it runs a script that creates an outlook signature from info in AD then adds a key to the registry. The script has run perfectly on about 20 machines that i have tested it on, however it doesn't work correctly on 3 machines. For these 3 machines it passes the check for the reg key then launches the sigcreate script but skips the actual creation and just adds the reg key. Am i missing something?

On Error Resume Next

Set objSysInfo = CreateObject("ADSystemInfo")

Set WshShell = CreateObject("WScript.Shell")

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

strName = objUser.FullName
strTitle = objUser.Description
strCred = objUser.info
strStreet = objUser.StreetAddress
strLocation = objUser.l
strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
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.Font.Name = "Arial"
objSelection.Font.Size = 11
if (strCred) Then objSelection.TypeText strName & ", " & strCred Else 
objSelection.TypeText strName
objSelection.TypeParagraph()
objSelection.TypeText "   " & strTitle
objSelection.TypeText Chr(11)
objSelection.TypeText "    " & strPhone
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.TypeText "Company Name"
objSelection.TypeText Chr(11)
objSelection.TypeText "Company Tagline"
objSelection.TypeText Chr(11)
objSelection.TypeText Chr(11)
objSelection.TypeText "Company Website"



Set objSelection = objDoc.Range()

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

objDoc.Saved = True
objWord.Quit

Set oShell = CreateObject("Wscript.Shell") 

sRegFile = "\\file1\users\Clerical\wallpaper\siglock.reg"
oShell.Run "regedit.exe /s " & Chr(34) & sRegFile & Chr(34), 0, True
A: 

problem solved....apparently there were some remnants of Word 2000 on these 3 machines...i cleaned it up and that fixed my issue

miak
Even if it's an answer written by yourself, check it as the correct answer and people will know that the question is "done". (You just won't get the reputation you normally get for having the correct answer).
ho1