<?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>Stefan Sobek Blog &#187; Scripting</title>
	<atom:link href="http://www.sobek.info/blog/category/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sobek.info/blog</link>
	<description>Writing about IT, Software Engineering, sports and other stuff</description>
	<lastBuildDate>Mon, 24 Jan 2011 12:50:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Load data from csv into html-table</title>
		<link>http://www.sobek.info/blog/2010/06/04/load-data-from-csv-into-html-table/</link>
		<comments>http://www.sobek.info/blog/2010/06/04/load-data-from-csv-into-html-table/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 07:23:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[csv2table]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=278</guid>
		<description><![CDATA[Situation:
Imagine your customer has a bunch of Excel-files which he wanted to display on a website in html-form. 
Problem:
What can you do here? You can write an importer to a database, or let the customer upload the excel file on a webserver and write a parser for the excel files etc. These are all non-trivial [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Situation:</strong><br />
Imagine your customer has a bunch of Excel-files which he wanted to display on a website in html-form. </p>
<p><strong>Problem:</strong><br />
What can you do here? You can write an importer to a database, or let the customer upload the excel file on a webserver and write a parser for the excel files etc. These are all non-trivial solutions for the problem that you want to easily display your information from the csv on a webpage into a table. </p>
<p><strong>Solution: </strong><br />
I found a plugin called jquery csv2table. This is very simple to use. A CSV-file will be read asynchrounosly and a HTML-table will be created of it. So you can simply let your customer load his csv file up and the table will be created automatically. Optional support of sorting, highlighting etc. Link: http://plugins.jquery.com/project/csv2table</p>
<p><strong>Example: </strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p278code2'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2782"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p278code2"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;view1&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#view1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">csv2table</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'./data/Book12.csv'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>This code will load the data from Book12.csv into the div &#8220;view1&#8243;. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2010/06/04/load-data-from-csv-into-html-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery introduction part 1</title>
		<link>http://www.sobek.info/blog/2010/04/01/jquery-introduction-part-1/</link>
		<comments>http://www.sobek.info/blog/2010/04/01/jquery-introduction-part-1/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 09:00:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery introduction]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=262</guid>
		<description><![CDATA[Why jquery or why use a js-lib at all?
There are many Javascript libraries on the market, e.g. script.aculo.us, jquery, dojo, Prototype and so on. For most of the tasks there is no special reason why jquery. It ist mostly a matter of actual knowledge of the developers to keep learning time low when there is [...]]]></description>
			<content:encoded><![CDATA[<h3><strong>Why jquery or why use a js-lib at all?</strong></h3>
<p>There are many Javascript libraries on the market, e.g. script.aculo.us, jquery, dojo, Prototype and so on. For most of the tasks there is no special reason why jquery. It ist mostly a matter of actual knowledge of the developers to keep learning time low when there is a basic knowledge available. Some JS-libs have an easier handling e.g. of json than other, in detail using json in jquery is simpler than in prototype.</p>
<p>Why should you use a js-lib at all? There are several reasons:</p>
<h4><strong>Simpler syntax and less code</strong></h4>
<p>Imagine you want to modify every div-element which has class &#8220;payment&#8221; assigned and want to set the background color to &#8220;#cccccc&#8221; to these elements.<br />
You have something like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p262code7'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2627"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p262code7"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;list&quot;&gt;
  &lt;div class=&quot;payment&quot;&gt;some text&lt;/div&gt;
  &lt;div&gt;some text&lt;/div&gt;
  &lt;div class=&quot;payment&quot;&gt;some text&lt;/div&gt;
  &lt;div class=&quot;payment&quot;&gt;some text&lt;/div&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>With normal JS you could do the job like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p262code8'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2628"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p262code8"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> list <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'list'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> list.<span style="color: #660066;">childNodes</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>list.<span style="color: #660066;">childNodes</span>.<span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;payment&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    	list.<span style="color: #660066;">childNodes</span>.<span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">style</span>.<span style="color: #660066;">backgroundColor</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'#cccccc'</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Ok, six lines of code and moderate readable but what with all browser support? Umpf. And imagine this is a simple example.</p>
<p>With jquery you do:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p262code9'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2629"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p262code9"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div.payment'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'background-color'</span> <span style="color: #339933;">,</span> <span style="color: #3366CC;">'#cccccc'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And this runs in all browsers.</p>
<h4><strong>Better readability</strong></h4>
<p>Isn&#8217;t the example above better readable? You use css-selectors for selecting elements in javascript.</p>
<p>E.g. you want to remove the class from the div elements which are childs of the div with id &#8220;list&#8221;.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p262code10'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p26210"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p262code10"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'div#list div.payment'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'payment'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<h4><strong>Better and easier extendability </strong></h4>
<p>You can simply create own plugins.</p>
<h4><strong>Multi-Browser compatibility</strong></h4>
<p>Nearly all functions will run in every browser.</p>
<h3><strong>There are often some cons why you should not use js-libs:</strong></h3>
<h4><strong>Big libray included</strong></h4>
<p>Yes it can be but e.g. with jquery you can use the compressed version for the live version. This will have only round about ~50k. And browser will cache the js file.</p>
<h4><strong>Higher loading times</strong></h4>
<p>Travering can be a costy thing, true. But with newer version it will become faster.</p>
<h3><strong>Conclusion</strong></h3>
<p>So I recommend using jquery because of the better readability, extendability and the separation of concerns.</p>
<h3><strong>Tip of the day: </strong></h3>
<p>Do not put JS-code inside html document when not needed. Use event-handling in outsourced js-file.</p>
<p>More infos about jquery you can find under <a title="jquery" href="http://www.javascriptkata.com/2007/05/29/3-reasons-why-i-use-jquery/" target="_blank">http://www.javascriptkata.com/2007/05/29/3-reasons-why-i-use-jquery/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2010/04/01/jquery-introduction-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OCR under linux</title>
		<link>http://www.sobek.info/blog/2010/02/08/ocr-under-linux/</link>
		<comments>http://www.sobek.info/blog/2010/02/08/ocr-under-linux/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:04:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[ocr]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[tif]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=60</guid>
		<description><![CDATA[Imagine you have a pdf-file you want to make ocr-recognition. Take a scenario where you want to automatically let your linux pc do the job, e.g. in a folder. 
I choose tesseract-ocr as ocr-programm. Easy to install and use and ok for my use. Unfortunately it takes only tif as input file type so that [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine you have a pdf-file you want to make ocr-recognition. Take a scenario where you want to automatically let your linux pc do the job, e.g. in a folder. </p>
<p>I choose tesseract-ocr as ocr-programm. Easy to install and use and ok for my use. Unfortunately it takes only tif as input file type so that we have to convert the pdf to tif first.</p>
<p><strong>To create a tif file with Ghostscript  from pdf:</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p60code13'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6013"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p60code13"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gs</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-r300</span> <span style="color: #660033;">-dBATCH</span> <span style="color: #660033;">-dNOPAUSE</span> <span style="color: #660033;">-sDEVICE</span>=tiff24nc  <span style="color: #660033;">-sOutputFile</span>=Dokument2.tif Dokument1.pdf</pre></td></tr></table></div>

<p><strong><br />
Now start OCR-recognition with tesseract-ocr (maybe you have to install it). </strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p60code14'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6014"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p60code14"><pre class="bash" style="font-family:monospace;"> tesseract Dokument2.tif doc.txt <span style="color: #660033;">-l</span> deu</pre></td></tr></table></div>

<p>-l deu means &#8220;Deutsch&#8221; for German language recognition.<br />
-r300 means 300 DPI</p>
<p>Now it is easy to create a script which will automatically check a folder for new files and start ocr etc. </p>
<p>E.g. you can create a shell-script and start this shell script via cronjob. Maybe I will write an example here later. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2010/02/08/ocr-under-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically send an email copy to a special address with outlook 2007</title>
		<link>http://www.sobek.info/blog/2009/11/26/automatically-send-an-email-copy-to-a-special-address-with-outlook-2007/</link>
		<comments>http://www.sobek.info/blog/2009/11/26/automatically-send-an-email-copy-to-a-special-address-with-outlook-2007/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 14:41:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[Automatic BCC]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[Outlook 2007]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=94</guid>
		<description><![CDATA[It is not possible in Outlook to send an email blind carbon copy to a special email address automatically. E.g. you would like to send a copy of each email you send to watcher@mymail.com automatically.
A small Visual Basic Script can do the job. Open Outlook 2007 and press Alt+F11 for the Visual Basic Editor and [...]]]></description>
			<content:encoded><![CDATA[<p>It is not possible in Outlook to send an email blind carbon copy to a special email address automatically. E.g. you would like to send a copy of each email you send to watcher@mymail.com automatically.</p>
<p>A small Visual Basic Script can do the job. Open Outlook 2007 and press <strong>Alt+F11</strong> for the Visual Basic Editor and put there the following code:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p94code17'); return false;">View Code</a> VBA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p9417"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code" id="p94code17"><pre class="vba" style="font-family:monospace;">Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strBcc As String
&nbsp;
Dim objItem As MailItem
Dim myRecipients As Recipients
Dim myRecipient As Recipient
&nbsp;
If Not ActiveInspector Is Nothing Then
If TypeOf ActiveInspector.CurrentItem Is MailItem Then
&nbsp;
strBcc = &quot;watcher@myemail.com&quot;
End If
End If
&nbsp;
On Error Resume Next
Set objRecip = Item.Recipients.Add(strBcc)
' handle case of user canceling Outlook security dialog
If Err = 287 Then
strMsg = &quot;Could not add a Bcc recipient &quot; &amp;amp; _
&quot;because the user said No to the security prompt.&quot; &amp;amp; _
&quot; Do you want still to send the message?&quot;
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
&quot;Security Prompt Cancelled&quot;)
If res = vbNo Then
Cancel = True
Else
objRecip.Delete
End If
Err.Clear
Else
objRecip.Type = olBCC
objRecip.Resolve
&nbsp;
End If
&nbsp;
Set objRecip = Nothing
&nbsp;
End Sub</pre></td></tr></table></div>

<p>Here is another version where you can filter the recipients and send mails to a special email address. E.g. you would like to send a bcc automatically to company1@mymail.com if you send mails to *@company1.com and to company2@mymail.com if you send mails to *@company2.com:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p94code18'); return false;">View Code</a> VBA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p9418"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre></td><td class="code" id="p94code18"><pre class="vba" style="font-family:monospace;">Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strBcc As String
&nbsp;
Dim objItem As MailItem
Dim myRecipients As Recipients
Dim myRecipient As Recipient
&nbsp;
If Not ActiveInspector Is Nothing Then
If TypeOf ActiveInspector.CurrentItem Is MailItem Then
Set objItem = ActiveInspector.CurrentItem
Set myRecipients = objItem.Recipients
myRecipients.ResolveAll
For Each myRecipient In myRecipients
&nbsp;
strBcc = &quot;&quot;
&nbsp;
If InStr(myRecipient.Address, &quot;company1.com&quot;) Then
strBcc = &quot;company1@mymail.com&quot;
End If
If InStr(myRecipient.Address, &quot;company2.com&quot;) Then
strBcc = &quot;company2@mymail.com&quot;
End If
&nbsp;
Next
End If
End If
&nbsp;
On Error Resume Next
Set objRecip = Item.Recipients.Add(strBcc)
' handle case of user canceling Outlook security dialog
If Err = 287 Then
strMsg = &quot;Could not add a Bcc recipient &quot; &amp;amp; _
&quot;because the user said No to the security prompt.&quot; &amp;amp; _
&quot; Do you want still to send the message?&quot;
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
&quot;Security Prompt Cancelled&quot;)
If res = vbNo Then
Cancel = True
Else
objRecip.Delete
End If
Err.Clear
Else
objRecip.Type = olBCC
objRecip.Resolve
&nbsp;
End If
&nbsp;
Set objRecip = Nothing
&nbsp;
End Sub</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/11/26/automatically-send-an-email-copy-to-a-special-address-with-outlook-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

