<?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: Open Any Email Attachment From Outlook</title>
	<atom:link href="http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/</link>
	<description>Automation and VBA code for Microsoft® Excel and Outlook</description>
	<lastBuildDate>Thu, 09 Sep 2010 14:13:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: JP</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-2811</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Tue, 07 Sep 2010 11:56:32 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-2811</guid>
		<description>Since it&#039;s a text file, use the Open statement to open and read the contents into a String variable. Then use Instr to check if the word appears in the String.

http://www.exceluser.com/explore/questions/vba_textcols.htm</description>
		<content:encoded><![CDATA[<p>Since it's a text file, use the Open statement to open and read the contents into a String variable. Then use Instr to check if the word appears in the String.</p>
<p><a href="http://www.exceluser.com/explore/questions/vba_textcols.htm" rel="nofollow">http://www.exceluser.com/explore/questions/vba_textcols.htm</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wesley</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-2808</link>
		<dc:creator>Wesley</dc:creator>
		<pubDate>Mon, 06 Sep 2010 18:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-2808</guid>
		<description>Hi JP

We receive a large number of confirmation emails from brokers, in .txt format
I have already used the code to save the attachments to a specified folder - works like a charm! 
My problem is that I need to open up these text files (which this code does) but also search for a keyword, say &quot;Eureka&quot;, and if it finds it, save the file with &quot;Eureka&quot; as a prefix to the name, if not then save it as the filename of the attachment.
How do I execute the find function using winshell on text files (.txt) and get the return value of true/false? Any help would be appreciated, however the working code would be legendary! :)

Regards
Wesley</description>
		<content:encoded><![CDATA[<p>Hi JP</p>
<p>We receive a large number of confirmation emails from brokers, in .txt format<br />
I have already used the code to save the attachments to a specified folder &#8211; works like a charm!<br />
My problem is that I need to open up these text files (which this code does) but also search for a keyword, say "Eureka", and if it finds it, save the file with "Eureka" as a prefix to the name, if not then save it as the filename of the attachment.<br />
How do I execute the find function using winshell on text files (.txt) and get the return value of true/false? Any help would be appreciated, however the working code would be legendary! <img src='http://www.codeforexcelandoutlook.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regards<br />
Wesley</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-1385</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Thu, 17 Dec 2009 01:44:21 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-1385</guid>
		<description>That means either:


	You don&#039;t have any program associated with the .url file extension, or
	You can only use the Run method with a file saved to disk.</description>
		<content:encoded><![CDATA[<p>That means either:</p>
<p>	You don't have any program associated with the .url file extension, or<br />
	You can only use the Run method with a file saved to disk.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shazad Rojan</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-1384</link>
		<dc:creator>Shazad Rojan</dc:creator>
		<pubDate>Wed, 16 Dec 2009 22:33:48 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-1384</guid>
		<description>Hi,

I tried to run the code as is in my outlook 2007 and got a run time error as follows:

Run-time error &#039;-2147024894 (80070002)&#039;;
Method &#039;Run&#039; of object &#039;IWshShell3&#039; failed.

Any help is appreciated as I don&#039;t know VBA

i am trying to allow users to directly launch a .url attachment and not saving to the disk and then launch it.  This is for our Accounting software (Navision).

Thank you.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I tried to run the code as is in my outlook 2007 and got a run time error as follows:</p>
<p>Run-time error '-2147024894 (80070002)';<br />
Method 'Run' of object 'IWshShell3' failed.</p>
<p>Any help is appreciated as I don't know VBA</p>
<p>i am trying to allow users to directly launch a .url attachment and not saving to the disk and then launch it.  This is for our Accounting software (Navision).</p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-1383</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Tue, 15 Sep 2009 23:31:53 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-1383</guid>
		<description>Open the VB IDE in Outlook by pressing Alt+F11. Go to Insert &#187; Module and then paste this code. To activate the macro from a toolbar button, visit &lt;a href=&quot;http://www.codeforexcelandoutlook.com/outlook-vba/resend-this-message/#toolbar&quot; rel=&quot;nofollow&quot;&gt;How to assign a macro to a toolbar button&lt;/a&gt;.

HTH</description>
		<content:encoded><![CDATA[<p>Open the VB IDE in Outlook by pressing Alt+F11. Go to Insert &raquo; Module and then paste this code. To activate the macro from a toolbar button, visit <a href="http://www.codeforexcelandoutlook.com/outlook-vba/resend-this-message/#toolbar" rel="nofollow">How to assign a macro to a toolbar button</a>.</p>
<p>HTH</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas K</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-1382</link>
		<dc:creator>Thomas K</dc:creator>
		<pubDate>Mon, 14 Sep 2009 01:10:14 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-1382</guid>
		<description>This looks like something i need. I want to be able to send an email and then outlooks open the program for the attached file.

The problem is, i don&#039;t know how to get the script from this site to outlook.

plz help ;)</description>
		<content:encoded><![CDATA[<p>This looks like something i need. I want to be able to send an email and then outlooks open the program for the attached file.</p>
<p>The problem is, i don't know how to get the script from this site to outlook.</p>
<p>plz help <img src='http://www.codeforexcelandoutlook.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-1381</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Wed, 15 Apr 2009 00:03:49 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-1381</guid>
		<description>Correct, your code will open all the attachments to an email. It should work with all registered file types, opening each one in its native application. I think a new version of the code is in order, where you can specify the folder.</description>
		<content:encoded><![CDATA[<p>Correct, your code will open all the attachments to an email. It should work with all registered file types, opening each one in its native application. I think a new version of the code is in order, where you can specify the folder.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: RBliss</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-1380</link>
		<dc:creator>RBliss</dc:creator>
		<pubDate>Tue, 14 Apr 2009 21:52:02 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-1380</guid>
		<description>The following code will open the attachments. (I&#039;ve only tested it with attachments of the same type. Not sure if it will work differently with mixed types.)

[cc lang=&#039;vb&#039;]Sub OpenAttachmentInNativeApp()
&#039; based on code posted by Sue Mosher
&#039; http://tinyurl.com/684zg4

Dim myShell As Object
Dim MyItem As Outlook.MailItem
Dim myAttachments As Outlook.Attachments
Dim i As Long
Dim Att As String

On Error Resume Next
Select Case TypeName(Application.ActiveWindow)
    Case &quot;Explorer&quot;
        Set MyItem = ActiveExplorer.Selection.Item(1)
    Case &quot;Inspector&quot;
        Set MyItem = ActiveInspector.CurrentItem
    Case Else
End Select
On Error GoTo 0

If MyItem Is Nothing Then
    GoTo ExitProc
End If

Set myAttachments = MyItem.Attachments
&#039; Windows Script Host Object
Set myShell = CreateObject(&quot;WScript.Shell&quot;)


If myAttachments.Count &gt; 0 Then
    For i = 1 To myAttachments.Count
        Att = myAttachments.Item(i).DisplayName
        &#039; delete just in case it exists from before
        On Error Resume Next
        Kill &quot;C:\&quot; &amp; Att
        On Error GoTo 0

        myAttachments.Item(i).SaveAsFile &quot;C:\&quot; &amp; Att
        myShell.Run &quot;C:\&quot; &amp; Att
    Next i
End If

ExitProc:
Set myAttachments = Nothing
Set MyItem = Nothing
Set myShell = Nothing
End Sub
[/cc]</description>
		<content:encoded><![CDATA[<p>The following code will open the attachments. (I've only tested it with attachments of the same type. Not sure if it will work differently with mixed types.)</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:630px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000080;">Sub</span> OpenAttachmentInNativeApp()<br />
<span style="color: #008000;">' based on code posted by Sue Mosher<br />
</span><span style="color: #008000;">' http://tinyurl.com/684zg4<br />
</span><br />
<span style="color: #000080;">Dim</span> myShell <span style="color: #000080;">As</span> <span style="color: #000080;">Object</span><br />
<span style="color: #000080;">Dim</span> MyItem <span style="color: #000080;">As</span> Outlook.MailItem<br />
<span style="color: #000080;">Dim</span> myAttachments <span style="color: #000080;">As</span> Outlook.Attachments<br />
<span style="color: #000080;">Dim</span> i <span style="color: #000080;">As</span> <span style="color: #000080;">Long</span><br />
<span style="color: #000080;">Dim</span> Att <span style="color: #000080;">As</span> <span style="color: #000080;">String</span><br />
<br />
<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span><br />
<span style="color: #000080;">Select</span> <span style="color: #000080;">Case</span> TypeName(Application.ActiveWindow)<br />
&nbsp; &nbsp; <span style="color: #000080;">Case</span> <span style="color: #800000;">&quot;Explorer&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">Set</span> MyItem = ActiveExplorer.Selection.Item(1)<br />
&nbsp; &nbsp; <span style="color: #000080;">Case</span> <span style="color: #800000;">&quot;Inspector&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">Set</span> MyItem = ActiveInspector.CurrentItem<br />
&nbsp; &nbsp; <span style="color: #000080;">Case</span> <span style="color: #000080;">Else</span><br />
<span style="color: #000080;">End</span> <span style="color: #000080;">Select</span><br />
<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> 0<br />
<br />
<span style="color: #000080;">If</span> MyItem <span style="color: #000080;">Is</span> <span style="color: #000080;">Nothing</span> <span style="color: #000080;">Then</span><br />
&nbsp; &nbsp; <span style="color: #000080;">GoTo</span> ExitProc<br />
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span><br />
<br />
<span style="color: #000080;">Set</span> myAttachments = MyItem.Attachments<br />
<span style="color: #008000;">' Windows Script Host Object<br />
</span><span style="color: #000080;">Set</span> myShell = CreateObject(<span style="color: #800000;">&quot;WScript.Shell&quot;</span>)<br />
<br />
<br />
<span style="color: #000080;">If</span> myAttachments.Count &gt; 0 <span style="color: #000080;">Then</span><br />
&nbsp; &nbsp; <span style="color: #000080;">For</span> i = 1 <span style="color: #000080;">To</span> myAttachments.Count<br />
&nbsp; &nbsp; &nbsp; &nbsp; Att = myAttachments.Item(i).DisplayName<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">' delete just in case it exists from before<br />
</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Kill <span style="color: #800000;">&quot;C:\&quot;</span> &amp; Att<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> 0<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; myAttachments.Item(i).SaveAsFile <span style="color: #800000;">&quot;C:\&quot;</span> &amp; Att<br />
&nbsp; &nbsp; &nbsp; &nbsp; myShell.Run <span style="color: #800000;">&quot;C:\&quot;</span> &amp; Att<br />
&nbsp; &nbsp; <span style="color: #000080;">Next</span> i<br />
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span><br />
<br />
ExitProc:<br />
<span style="color: #000080;">Set</span> myAttachments = <span style="color: #000080;">Nothing</span><br />
<span style="color: #000080;">Set</span> MyItem = <span style="color: #000080;">Nothing</span><br />
<span style="color: #000080;">Set</span> myShell = <span style="color: #000080;">Nothing</span><br />
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></div></div>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-1379</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Fri, 17 Oct 2008 20:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-1379</guid>
		<description>Glad to hear it Mohamed! I mean, I hope it was useful.

--JP</description>
		<content:encoded><![CDATA[<p>Glad to hear it Mohamed! I mean, I hope it was useful.</p>
<p>&#8211;JP</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohamed Abdel Nabyu</title>
		<link>http://www.codeforexcelandoutlook.com/blog/2008/05/open-any-email-attachment-from-outlook/#comment-1378</link>
		<dc:creator>Mohamed Abdel Nabyu</dc:creator>
		<pubDate>Wed, 15 Oct 2008 13:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://jimmypena.wordpress.com/2008/05/29/open-any-email-attachment-from-outlook/#comment-1378</guid>
		<description>Thanks a lot
I give the code to our secretary &amp; she was impressed</description>
		<content:encoded><![CDATA[<p>Thanks a lot<br />
I give the code to our secretary &#038; she was impressed</p>
]]></content:encoded>
	</item>
</channel>
</rss>
