How the template files were created

The automated Outlook signature script relies on two template files to work.
One file is the HTML template and the other is the Rich Text Format (RTF).

These template files are read into memory, by the script, modified and then written to the users profile to produce the required Outlook Signature files.

One of the main reasons I use template files rather than outputting the raw formating direct from the script is the requirement to generate an RTF signature file. I really couldn’t face trying to learn the RTF specification when I can just use Word 2007 to do the heavy lifting for me.

If you already know the specification or are having trouble sleeping then feel free to take my script and write an RTF generator. I could have probably written the script to generate the HTML but I  use the HTML template file to generate the RTF template from within Word 2007. The template files have place holders within them for each element of the template that needs to be updated.

  • SIGCOLUMN1SIG
  •  SIGCOLUMN2SIG
  •  SIGCOLUMN3SIG
  • SIGENVIROPRINTSIG

I created the HTML template from scratch using a free HTML editor, SeaMonkey.
HTML Signature Template File

I used an HTML editor, rather than Outlook, Word or other WYSIWIG HTML editor, to generate the HTML template as I wanted the cleanest HTML code I could get.
HTML Template RAW view

Once I was happy that this file had the correct look and formatting I then opened this up in word 2007.
Template file open in word 2007

I used word 2007 to save the fie as RTF without doing any additional editing.
Save as RTF

So all the script has to do is load the template files into a string variable and do a find and replace on the place holders to produce the required content. During my testing that has proved to be sufficiently quick for a normal logon process.

Note:
The text signature file is generated from scratch within the script without using a template file.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s