March 30, 2007
The steps to create mail signature in Outlook manually are not so complex to perform. But as it usually happens, this ‘rule’ cannot be applied to all cases. Once you can burden this task on user’s shoulders in a small company with a few computers in net and probably no Active Directory, go do it in large company. Even in relatively large company it’s nearly impossible to force users to go beyond corporate rules on formatting the signature. At any time in any place chances are very high we will get the chaos within the settings of users’ signatures. Ones just will be unable to create them at all, others will leave your direction and not set signature at all, while the rest will edit the standardized formatting to what they like to look like and… You will get the chaos. Imagine you will start labeling your corporate logo differently each time you put it somewhere. John will put it that like, Marianne will add some flowers at the very left conner of the logo because she is delighted with the Spring that came earlier (later?) this year. Absurd? For sure. Logo is that kind of things that usually changes only by common agreement and cannot change and depend on the each single person wish. Surely, you can create legal notices, you can stick banners screaming on users and forcing them to comply the rules. But the question is: should you do that? Or to say it better: should THEY do it? At least they were employed to do what they are specializing in and what they can do best, so why bothering them with excess problems and drawing them away from their internal responsibilities. While there are things that people should be able to freely made themselves, there are things at the same time that must be standardized. Just for the sake of following corporate rules, for the sake of what any standards are created for.
First Steps to Automate Creation of Outlook Signature
Here I will go through the process describing the process of how to create e-mail signature for Outlook using automation in the step-by-step manner.
The first thing you start thinking about automation is probably scripting. And because we want to add text here, we need to use Microsoft Office Word. Moreover, Outlook object model as it seemingly seems does not include methods that would allow to create and assign signatures for e-mail messages.
First of all we need to open our application. Because we will use Word here, we need to start Word application.
Set objWord = CreateObject(“Word.Application”)
We are creating objWord object to do that. If we want our application to be visible as we start it allowing the user to see the main application window, we need to set object property accordingly. Thus we can set Visible property of objWord instance to true.
‘objWord.Visible = True
Uncomment the string in the script and you’ll see the window displayed without any document opened in it. Comment it back on and you’ll see only the process instance displayed within the list of your task manager. But aren’t we here to create the signature? To create it we need to create a document that we will fill in further with signature info. To create a new document we need to use Add method and create a objDoc object which will designate the document we are creating:
Set objDoc = objWord.Documents.Add()
Alright. We created the document. Let’s start righting the text. We need some method that will do the job for us. Something like TypeText would be able to do that job for us. But the objWord object doesn’t have such a method contained within its object model. What should we do? Right what we do when we start typing out document. We should put an insertion point within it. What cannot be done with one object can be done with another one. The first thing that Scripting Guys are suggesting to use to type e-mail signature in live is to create Word’s Selection object. Here’s how we do that:
Set objSelection = objWord.Selection
Now we can start writing our first string of text to build the signature. We need to invoke the mentioned TypeText method here:
objDoc.TypeText “FirstName LastName”
Where the FirstName and the LastName strings are placeholders for the text that will be typed in the document. Thus if you will put John Doe here, and run the TypeText method you will see the John Doe string written in the first row of the Microsoft Word document. Now then we usually type the company name under the personal name. Okay, let’s write the name of the company. Let it be the mysterious ACME Corporation:
objDoc.TypeText “FirstName LastName”
But wait, why we got out strings sticked one to each other? That’s because we forgot to do out second action we do when we type the documents, breaking the line and inserting line feed and caret return to it. That is we need to put here our well-known “Press ENTER to continue”. What’s Enter in Word? It is paragraph. Strictly speaking paragraph is more complex thing in Word because it holds style and formatting info, but let cut its capabilities to such a limited scope. To put the paragraph we should add this
line to the code.
You can find the whole article here
Extra info on scripts utilizing XML and HTA can be found here
Script Automation: Automatic Genereation of E-mail Signatures on User Side Without User Intervention
How to find and use Office object model documentation
Programming the Outlook object model
Technorati tags: ADSI scripting corporate signature object model outlook object model word object model personal signature mail signature scripting active directory Microsoft Office outlook profiles VBScript outlook signature generate signature
Sending messages without a signature is not what one would call etiquette correct. Surely when we are mailing to each other in a limited set of participants where everyone knows another person quite well, having a signature can be an excess. But once we are talking about business communications having a proper signature becomes a must.
That’s when we get why we need Word to be a default editor for composing Outlook messages.
How do we setup a signature
For personal needs we do the following
In this example Office Outlook 2003 and Office Word 2003 are covered
1. Launch Outlook and choose Tools|Options to open the Options dialog box
2. In the Options dialog box switch to the Mail Format tab
3. In the Message format select HTML from the Compose in this message format drop-down list
4. Check the Use Microsoft Office Word 2003 to edit e-mail messages
5. Under Signature select account to be which you want the signature be assigned to
6. Click Signatures button and click New button to create the signature.
7. Enter a name to set how you wish signature to be listed in the list of signatures. This is needed to differentiate between signature is you have several signature. I recommend naming convention to be FirstName LastName [Type][Lang] where the stands for the signature type and is used to differentiate between corporate and personal signature. Lang designates the language of the signature what is useful if you work with multilingual customers. So name it to be named as John Doe [Corp][EN], John Doe [Corp][DE], etc
8. If it’s your brand new signature and you have no previously created signatures there, select Start with a blank signature and click Next
9. While in the Signature text box click Advanced Edit to launch Microsoft Office Word
10. When Word will start, type your signature, format it accordingly to confirm personal preferences or corporate rules
11. Save changes to the edited document
There is a nice demo on how to create, apply formatting to bring some elegance to it, and manage profiles by switching between signatures if you have say your corporate and personal signatures.
Inserting signature in a message
Signature Management with Outlook Profiles in Domain environment
Sign off simply in Microsoft Office Word