Monday, June 3, 2013

Script VB para configurar assinatura HTML no Outlook 2010

Script:
' Command-line arguments reading
html_file_path = WScript.Arguments(0) ' path to the HTML signature file
signature_name = WScript.Arguments(1) ' signature name

' MS Word invocation
Set objWord = CreateObject("Word.Application")
' open HTML file
Set objNewSignature = objWord.Documents.Open(html_file_path, , true, false, , , , , , 7, , false)
' create Outlook signature objects
Set objSelectionDefault = objNewSignature.Range()
Set objSignatureObjects = objWord.EmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObjects.EmailSignatureEntries
' configure the signature
objSignatureEntries.Add signature_name, objSelectionDefault
objSignatureObjects.NewMessageSignature = signature_name
objSignatureObjects.ReplyMessageSignature = signature_name
' close MS Word
objWord.Quit
Exemplo de uso: script.vbs "[arquivo html]"[nome da assinatura]

No comments: