<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Outlook rule to save attachments to a web directory</title>
	<atom:link href="http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/feed/" rel="self" type="application/rss+xml" />
	<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/</link>
	<description>Design.  Develop.  Defy.</description>
	<lastBuildDate>Fri, 18 May 2012 14:28:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: apar</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-373</link>
		<dc:creator>apar</dc:creator>
		<pubDate>Fri, 18 May 2012 14:28:08 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-373</guid>
		<description>Thanks for the code. The code works fine a few times. Some times the attachments are not saved.
I debugged and figured out what the issue was. Most of the items the mail item does not have attachments. In my opinion, that is because, the code gets activated even before the mail attachment gets downloaded completely. Is there anyway, I can get the rule to act a few seconds after the mail arrives than right away?

Thanks</description>
		<content:encoded><![CDATA[<p>Thanks for the code. The code works fine a few times. Some times the attachments are not saved.<br />
I debugged and figured out what the issue was. Most of the items the mail item does not have attachments. In my opinion, that is because, the code gets activated even before the mail attachment gets downloaded completely. Is there anyway, I can get the rule to act a few seconds after the mail arrives than right away?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jennifer Bennett</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-372</link>
		<dc:creator>Jennifer Bennett</dc:creator>
		<pubDate>Thu, 17 May 2012 18:52:04 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-372</guid>
		<description>This was extremely helpful for what i needed. I have a few question on this as far as the functions I need to use this for:

1. I am trying to put this file in a ftp network so what i would have to do is change this line strFolderPath to something else but I was unsure how to code it to a specific networking pathway through an EI directoty

2. The file names and formats are specific in the manner they are sent.. i was curious if this would work for that:
strFilename = Item.Subject &amp; ” ” &amp; Format(CDate(Now), “yyyy_MM_dd”) &amp; “.pdf”


as far as the format ..it would be &quot;wildcard_wildcard_ATMC&quot; &quot;wildcard_wildcard_OHT&quot;

They are send by subject lines in the the first twofield attributes but are distinguished to wish EI path by the &quot;_OHT&quot; attribute


Any help you could provide would be appreciative.</description>
		<content:encoded><![CDATA[<p>This was extremely helpful for what i needed. I have a few question on this as far as the functions I need to use this for:</p>
<p>1. I am trying to put this file in a ftp network so what i would have to do is change this line strFolderPath to something else but I was unsure how to code it to a specific networking pathway through an EI directoty</p>
<p>2. The file names and formats are specific in the manner they are sent.. i was curious if this would work for that:<br />
strFilename = Item.Subject &amp; ” ” &amp; Format(CDate(Now), “yyyy_MM_dd”) &amp; “.pdf”</p>
<p>as far as the format ..it would be &#8220;wildcard_wildcard_ATMC&#8221; &#8220;wildcard_wildcard_OHT&#8221;</p>
<p>They are send by subject lines in the the first twofield attributes but are distinguished to wish EI path by the &#8220;_OHT&#8221; attribute</p>
<p>Any help you could provide would be appreciative.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sue</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-371</link>
		<dc:creator>Sue</dc:creator>
		<pubDate>Tue, 15 May 2012 20:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-371</guid>
		<description>&lt;a href=&quot;#comment-321&quot; rel=&quot;nofollow&quot;&gt;@Thantos &lt;/a&gt; 
I would like to pull both &quot;pdf&quot; and &quot;tif&quot; attachment out to a folder - how would I modify the script to do this?</description>
		<content:encoded><![CDATA[<p><a href="#comment-321" rel="nofollow">@Thantos </a><br />
I would like to pull both &#8220;pdf&#8221; and &#8220;tif&#8221; attachment out to a folder &#8211; how would I modify the script to do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-370</link>
		<dc:creator>Drew</dc:creator>
		<pubDate>Sat, 28 Apr 2012 03:20:34 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-370</guid>
		<description>Thank you, this is perfect. I have Google Analytics set up to email PDFs of my visitor data on a weekly basis. With close to 10 websites that I monitor regularly, this enabled me to have the files automatically downloaded to a single directory.

Works perfectly in MS Outlook 2010
Just modified the path to where my files are to be stored and replaced &quot;htm&quot; to &quot;pdf&quot; where appropriate.

Thank you for this!</description>
		<content:encoded><![CDATA[<p>Thank you, this is perfect. I have Google Analytics set up to email PDFs of my visitor data on a weekly basis. With close to 10 websites that I monitor regularly, this enabled me to have the files automatically downloaded to a single directory.</p>
<p>Works perfectly in MS Outlook 2010<br />
Just modified the path to where my files are to be stored and replaced &#8220;htm&#8221; to &#8220;pdf&#8221; where appropriate.</p>
<p>Thank you for this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DavidA</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-369</link>
		<dc:creator>DavidA</dc:creator>
		<pubDate>Thu, 02 Feb 2012 19:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-369</guid>
		<description>Thanks for sharing. I am using this to file my receipts: I want to take a picture from my phone and send it to myself. I had to edit the folder location where I wanted my attachments saved as well as the attachment extension. It is working great.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing. I am using this to file my receipts: I want to take a picture from my phone and send it to myself. I had to edit the folder location where I wanted my attachments saved as well as the attachment extension. It is working great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-367</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 22 Jan 2012 21:40:45 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-367</guid>
		<description>This isn&#039;t working for me. The rule is moving the emails to a folder, but it isn&#039;t saving the attachments. The first time I manually ran the rule it asked for permission to run the script due to security, and I allowed it. This is the line I have edited in the code. It&#039;s a valid path. Nothing is being saved to disk.
strRootFolderPath = &quot;e:\backup\&quot;</description>
		<content:encoded><![CDATA[<p>This isn&#8217;t working for me. The rule is moving the emails to a folder, but it isn&#8217;t saving the attachments. The first time I manually ran the rule it asked for permission to run the script due to security, and I allowed it. This is the line I have edited in the code. It&#8217;s a valid path. Nothing is being saved to disk.<br />
strRootFolderPath = &#8220;e:\backup\&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Smith</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-352</link>
		<dc:creator>Scott Smith</dc:creator>
		<pubDate>Mon, 27 Jun 2011 04:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-352</guid>
		<description>This code was exactly waht I was looking for.  However I want to add one thing.   How do I run a an mdb file after I have this code save a txt file?

I am going to use this to save incoming text files, but I need to run an mdb file to add them to my database.

Scott</description>
		<content:encoded><![CDATA[<p>This code was exactly waht I was looking for.  However I want to add one thing.   How do I run a an mdb file after I have this code save a txt file?</p>
<p>I am going to use this to save incoming text files, but I need to run an mdb file to add them to my database.</p>
<p>Scott</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thantos</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-340</link>
		<dc:creator>Thantos</dc:creator>
		<pubDate>Sat, 09 Apr 2011 22:07:03 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-340</guid>
		<description>This definitely sounds doable.  You should be able to embed the code that you supplied into my code.  The hard part is parsing the PDF file and saving each page as part of the TIFF, though, and then saving everything in the designated directory.  Here is my attached code; I merged the two code snippets together, but PLEASE NOTE that I have not tested it.  I am sure that it will need some tweaking, but it will hopefully point you in the right direction.  Once I get a bit more free time (my apologies, as I am swamped now), I will see if I can get this working 100%.


&lt;blockquote&gt;Sub SaveAttachmentsToDisk(Item As Outlook.MailItem)
Dim olkFolder As Outlook.MAPIFolder, _
olkAttachment As Outlook.Attachment, _
objFSO As Object, _
strRootFolderPath As String, _
strFilename As String, _
intCount As Integer
Dim noAppend As TiffEncoder = New TiffEncoder(TiffCompression.Default, True)
Dim pdf As PdfDecoder = New PdfDecoder(XXX)
Dim i As Integer=0
&#039;Change the following path to match your environment
strRootFolderPath = &quot;z:\www\departments\webreports\&quot;
Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set olkFolder = Application.ActiveExplorer.CurrentFolder
If Item.Attachments.Count &gt; 0 Then
For Each olkAttachment In Item.Attachments
If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = &quot;pdf&quot; Then
strFilename = olkAttachment.FileName

&#039;Begin conversion of PDF to TIFF
Do While i&lt; numPages
	Dim img As AtalaImage = pdfDecoder.Read(strFilename,i,Nothing)
	noAppend.Save(outStream, img, Nothing)
	img.Dispose(XXX)
	outStream.Seek(0, SeekOrigin.Begin)
	i += 1
Loop		
intCount = 0
Do While True
If objFSO.FileExists(strRootFolderPath &amp; strFilename) Then
intCount = intCount + 1
objFSO.deletefile (strRootFolderPath &amp; strFilename)
Else
Exit Do
End If
Loop
&#039;Save TIFF
img.SaveAsFile strRootFolderPath &amp; strFilename
olkAttachment.SaveAsFile strRootFolderPath &amp; strFilename
End If
Next
End If
Set objFSO = Nothing
Set olkAttachment = Nothing
Set olkFolder = Nothing
End Sub&lt;/blockquote&gt;

</description>
		<content:encoded><![CDATA[<p>This definitely sounds doable.  You should be able to embed the code that you supplied into my code.  The hard part is parsing the PDF file and saving each page as part of the TIFF, though, and then saving everything in the designated directory.  Here is my attached code; I merged the two code snippets together, but PLEASE NOTE that I have not tested it.  I am sure that it will need some tweaking, but it will hopefully point you in the right direction.  Once I get a bit more free time (my apologies, as I am swamped now), I will see if I can get this working 100%.</p>
<blockquote><p>Sub SaveAttachmentsToDisk(Item As Outlook.MailItem)<br />
Dim olkFolder As Outlook.MAPIFolder, _<br />
olkAttachment As Outlook.Attachment, _<br />
objFSO As Object, _<br />
strRootFolderPath As String, _<br />
strFilename As String, _<br />
intCount As Integer<br />
Dim noAppend As TiffEncoder = New TiffEncoder(TiffCompression.Default, True)<br />
Dim pdf As PdfDecoder = New PdfDecoder(XXX)<br />
Dim i As Integer=0<br />
&#8216;Change the following path to match your environment<br />
strRootFolderPath = &#8220;z:\www\departments\webreports\&#8221;<br />
Set objFSO = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
Set olkFolder = Application.ActiveExplorer.CurrentFolder<br />
If Item.Attachments.Count > 0 Then<br />
For Each olkAttachment In Item.Attachments<br />
If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = &#8220;pdf&#8221; Then<br />
strFilename = olkAttachment.FileName</p>
<p>&#8216;Begin conversion of PDF to TIFF<br />
Do While i< numPages<br />
	Dim img As AtalaImage = pdfDecoder.Read(strFilename,i,Nothing)<br />
	noAppend.Save(outStream, img, Nothing)<br />
	img.Dispose(XXX)<br />
	outStream.Seek(0, SeekOrigin.Begin)<br />
	i += 1<br />
Loop<br />
intCount = 0<br />
Do While True<br />
If objFSO.FileExists(strRootFolderPath &#038; strFilename) Then<br />
intCount = intCount + 1<br />
objFSO.deletefile (strRootFolderPath &#038; strFilename)<br />
Else<br />
Exit Do<br />
End If<br />
Loop<br />
'Save TIFF<br />
img.SaveAsFile strRootFolderPath &#038; strFilename<br />
olkAttachment.SaveAsFile strRootFolderPath &#038; strFilename<br />
End If<br />
Next<br />
End If<br />
Set objFSO = Nothing<br />
Set olkAttachment = Nothing<br />
Set olkFolder = Nothing<br />
End Sub</p></blockquote>
</blockquote>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sue</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-332</link>
		<dc:creator>Sue</dc:creator>
		<pubDate>Wed, 23 Mar 2011 18:18:42 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-332</guid>
		<description>I am using your code above to save PDF attachments to folder.  My goal however is to extract PDF attachments from e-mail, convert them to multi-page TIFF image before saving to a folder.  Would it be possible to combine this code with yours to attain my goal? http://www.ehow.com/how_7645423_convert-pdf-tiff-vbnet.html</description>
		<content:encoded><![CDATA[<p>I am using your code above to save PDF attachments to folder.  My goal however is to extract PDF attachments from e-mail, convert them to multi-page TIFF image before saving to a folder.  Would it be possible to combine this code with yours to attain my goal? <a href="http://www.ehow.com/how_7645423_convert-pdf-tiff-vbnet.html" rel="nofollow">http://www.ehow.com/how_7645423_convert-pdf-tiff-vbnet.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thantos</title>
		<link>http://lightyeardesign.com/2009/04/outlook-rule-to-extract-attachments-to-a-web-directory/comment-page-1/#comment-321</link>
		<dc:creator>Thantos</dc:creator>
		<pubDate>Thu, 10 Feb 2011 19:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://lightyeardesign.com/?p=13#comment-321</guid>
		<description>ben,
Try changing this line:

If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = &quot;htm&quot; Then


to:

If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = &quot;pdf&quot; Then

What did we change?  The &quot;htm&quot; attachment specification to &quot;pdf&quot;</description>
		<content:encoded><![CDATA[<p>ben,<br />
Try changing this line:</p>
<p>If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = &#8220;htm&#8221; Then</p>
<p>to:</p>
<p>If objFSO.GetExtensionName(LCase(olkAttachment.FileName)) = &#8220;pdf&#8221; Then</p>
<p>What did we change?  The &#8220;htm&#8221; attachment specification to &#8220;pdf&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

