Jump to content

Recommended Posts

Posted

I have been using a script I wrote about 4 years ago to set users' signatures on login. This has worked fine until a couple of days ago when vbscript has started throwing an error:

 

Error: Object doesn't support this property or method: 'NewMessageSignature'

Code: 800A01B6

Source: Microsoft VBScript runtime error

 

 

I have stripped the rather long script down into the raw basics of generating a signature of a single word and adding it (no AD queries etc to interfere or cause problems). The signature is added and I can see it if I go into outlook under the signatures preferences, but the signature is not added for new or reply messages.

 

The block of code it falls over on is:

objSignatureEntries.Add strSignatureName, objSelection
objSignatureEntries.NewMessageSignature = strSignatureName
objSignatureEntries.ReplyMessageSignature = strSignatureName

 

I have not deployed any new WSUS updates around the time of this problem appearing, and the script has been unchanged for at least a year. This is happening on both Outlook 2007 and Outlook 2010.

 

Has anyone got any ideas or suggestions, or has anyone else started experiencing this problem?

 

Thanks,

 

James

 

 

Option Explicit

Dim objNet : Set objNet = CreateObject("WScript.NetWork")
Dim objFSO : set objFSO = createobject("Scripting.FileSystemObject")
Dim objShell : Set objShell = WScript.CreateObject("WSCript.shell")

Dim objWord : Set objWord = CreateObject("Word.Application")

Dim objDoc : Set objDoc = objWord.Documents.Add()
Dim objSelection : Set objSelection = objWord.Selection

Dim objEmailOptions : Set objEmailOptions = objWord.EmailOptions
Dim objSignatureObjects : Set objSignatureObjects = objWord.EmailOptions.EmailSignature

Dim objSignatureEntries : Set objSignatureEntries = objSignatureObjects.EmailSignatureEntries

objSelection.TypeParagraph
objSelection.TypeText "test"

Set objSelection = objDoc.Range()

Dim strSignatureName : strSignatureName = "test"

objSignatureEntries.Add strSignatureName, objSelection
objSignatureEntries.NewMessageSignature = strSignatureName
objSignatureEntries.ReplyMessageSignature = strSignatureName

objDoc.Saved = TRUE
objDoc.Close 0
objWord.Quit

Posted

Seems an error had found its way into the script. The offending block should read:

 

objSignatureEntries.Add strSignatureName, objSelection
objSignatureObjects.NewMessageSignature = strSignatureName
objSignatureObjects.ReplyMessageSignature = strSignatureName

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...