<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shawson&#039;s Code Blog &#187; vb</title>
	<atom:link href="http://codeblog.shawson.co.uk/category/vb/feed/" rel="self" type="application/rss+xml" />
	<link>http://codeblog.shawson.co.uk</link>
	<description>development notes for my failing memory</description>
	<lastBuildDate>Wed, 01 Feb 2012 11:00:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Automatically creating outlook signatures using LDAP and a VB Login script</title>
		<link>http://codeblog.shawson.co.uk/automatically-creating-outlook-signatures-using-ldap-and-a-vb-login-script/</link>
		<comments>http://codeblog.shawson.co.uk/automatically-creating-outlook-signatures-using-ldap-and-a-vb-login-script/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 13:25:00 +0000</pubDate>
		<dc:creator>shawson</dc:creator>
				<category><![CDATA[vb]]></category>

		<guid isPermaLink="false">http://www.shawson.co.uk/codeblog/post.aspx?id=03d0c07a-9866-49a7-9b03-2be7eef05cee</guid>
		<description><![CDATA[This is a nice way of automatically building up outlook email signatures- the example given doesn&#8217;t include an image though, and it needs accurate LDAP data!  This code originated here and i copy it here incase that article ever dissapears! Set objUser = CreateObject(&#34;WScript.Network&#34;) userName = objUser.UserName domainName = objUser.UserDomain FUNCTION GetUserDN(BYVAL UN, BYVAL DN) [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is a nice way of automatically building up outlook email signatures- the example given doesn&#8217;t include an image though, and it needs accurate LDAP data!  This <a href="http://robwhitehouse.com/windows/script-auto-generate-outlook-signature/">code originated here</a> and i copy it here incase that article ever dissapears!</p>
<pre class="brush: vb"> Set objUser = CreateObject(&quot;WScript.Network&quot;)
userName = objUser.UserName
domainName = objUser.UserDomain

FUNCTION GetUserDN(BYVAL UN, BYVAL DN)
Set ObjTrans = CreateObject(&quot;NameTranslate&quot;)
objTrans.init 1, DN
objTrans.set 3, DN &amp; &quot;\&quot; &amp; UN
strUserDN = objTrans.Get(1)
GetUserDN = strUserDN
END FUNCTION

Set objLDAPUser = GetObject(&quot;LDAP://&quot; &amp; GetUserDN(userName,domainName))

&#039;Prepare to create some files
Dim objFSO, objWsh, appDataPath, pathToCopyTo, plainTextFile,
plainTextFilePath, richTextFile, richTextFilePath, htmlFile,
htmlFilePath
Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objWsh = CreateObject(&quot;WScript.Shell&quot;)
appDataPath = objWsh.ExpandEnvironmentStrings(&quot;%APPDATA%&quot;)
pathToCopyTo = appDataPath &amp; &quot;\Microsoft\Signatures\&quot;

&#039;Let&#039;s create the plain text signature
plainTextFilePath = pathToCopyTo &amp; &quot;Default.txt&quot;
Set plainTextFile = objFSO.CreateTextFile(plainTextFilePath, TRUE)
plainTextFile.WriteLine(&quot;-- &quot;)
plainTextFile.WriteLine(objLDAPUser.DisplayName)
plainTextFile.WriteLine(objLDAPUser.title)
plainTextFile.WriteLine(objLDAPUser.company)
plainTextFile.WriteLine(&quot;t: &quot; &amp; objLDAPUser.telephoneNumber)
plainTextFile.WriteLine(&quot;f: &quot; &amp; objLDAPUser.facsimileTelephoneNumber)
plainTextFile.WriteLine(&quot;e: &quot; &amp; objLDAPUser.mail)
plainTextFile.Write(&quot;w: &quot; &amp; objLDAPUser.wWWHomePage)
plainTextFile.Close

&#039;Now we create the Rich Text signature
richTextFilePath = pathToCopyTo &amp; &quot;Default.rtf&quot;
Set richTextFile = objFSO.CreateTextFile(richTextFilePath, TRUE)
richTextFile.WriteLine(&quot;{\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fswiss\fcharset0
Arial;}}&quot;)
richTextFile.WriteLine(&quot;\viewkind4\uc1\pard\f0\fs20 -- \par&quot;)
richTextFile.WriteLine(objLDAPUser.DisplayName &amp; &quot;\par&quot;)
richTextFile.WriteLine(objLDAPUser.title &amp; &quot;\par&quot;)
richTextFile.WriteLine(objLDAPUser.company &amp; &quot;\par&quot;)
richTextFile.WriteLine(&quot;t: &quot; &amp; objLDAPUser.telephoneNumber &amp; &quot;\par&quot;)
richTextFile.WriteLine(&quot;f: &quot; &amp; objLDAPUser.facsimileTelephoneNumber &amp; &quot;\par&quot;)
richTextFile.WriteLine(&quot;e: &quot; &amp; objLDAPUser.mail &amp; &quot;\par&quot;)
richTextFile.WriteLine(&quot;w: &quot; &amp; objLDAPUser.wWWHomePage &amp; &quot;\par&quot;)
richTextFile.Write(&quot;}&quot;)
richTextFile.Close

&#039;And finally, the HTML signature
htmlFilePath = pathToCopyTo &amp; &quot;Default.htm&quot;
Set htmlFile = objFSO.CreateTextFile(htmlFilePath, TRUE)
htmlfile.WriteLine(&quot;&lt;!DOCTYPE html PUBLIC &quot;&quot;-//W3C//DTD XHTML 1.0
Transitional//EN&quot;&quot;
&quot;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&quot;&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;html xmlns=&quot;&quot;http://www.w3.org/1999/xhtml&quot;&quot; &gt;&quot;)
htmlfile.WriteLine(&quot;&lt;body&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div style=&quot;&quot;font-size:10pt;
font-family:&#039;Arial&#039;,&#039;helvetica&#039;;&quot;&quot;&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div&gt;-- &lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div&gt;&quot; &amp; objLDAPUser.DisplayName &amp; &quot;&lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div&gt;&quot; &amp; objLDAPUser.title &amp; &quot;&lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div&gt;&quot; &amp; objLDAPUser.company &amp; &quot;&lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div&gt;t: &quot; &amp; objLDAPUser.telephoneNumber &amp; &quot;&lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div&gt;f: &quot; &amp; objLDAPUser.facsimileTelephoneNumber &amp; &quot;&lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div&gt;e: &lt;a href=&quot;&quot; &amp; objLDAPUser.mail &amp; &quot;&quot;&gt;&quot; &amp;
objLDAPUser.mail &amp; &quot;&lt;/a&gt;&lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;div&gt;w: &lt;a href=&quot;&quot;http://&quot; &amp;
objLDAPUser.wWWHomePage &amp; &quot;&quot;&quot;&gt;&quot; &amp; objLDAPUser.wWWHomePage &amp;
&quot;&lt;/a&gt;&lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;/div&gt;&quot;)
htmlfile.WriteLine(&quot;&lt;/body&gt;&quot;)
htmlfile.Write(&quot;&lt;/html&gt;&quot;)
</pre>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://codeblog.shawson.co.uk/automatically-creating-outlook-signatures-using-ldap-and-a-vb-login-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

