Search code examples
outlookvbscript

Login script using EmailSignature.NewMessageSignature property does not populate in Outlook


I have been experimenting with this object.property in a logon script and have the following snippit of code. It does not seem to populate in Outlook in the default signatures. Has anyone had any luck with this? I am using MS Office 2016

    ...
    SigFilename = "CompanyDefault.htm"
    ...
    'Applying the signature in Outlook’s settings.
    Set objWord = CreateObject("Word.Application")
    Set objSignatureObjects = objWord.EmailOptions.EmailSignature
    
    'Setting the signature as default for new messages.
    objSignatureObjects.NewMessageSignature = SigFilename
    
    'Setting the signature as default for replies & forwards.
    objSignatureObjects.ReplyMessageSignature = SigFilename
    objWord.Quit

Solution

  • Firstly, NewMessageSignature and ReplyMessageSignature take the name of the signature (e.g. "CompanyDefault"), not the file name ("CompanyDefault.htm").

    If you want to manipulate Outlook signatures directly, you can do so using Redemption (I am its author) - it exposes the RDOSession.Signatures collection (returns RDOSignatures object), as well as RDOAccount.ReplySignature and NewMessageSignature properties (retuirn and take RDOSignature object).