<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>File Attachment using VB Script</title><link>https://www.infopathdev.com:443/forums/thread/55900.aspx</link><pubDate>Wed, 16 Jun 2010 04:33:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:55900</guid><dc:creator>martinpalmer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/55900.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=55900</wfw:commentRss><description>&lt;p&gt;I need to be able to send attachments through the Send&amp;nbsp;Mail method in VB Script. So I have read alot on this being done in C# but I need it in VB Script.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;span class="pBody postableBody"&gt;I have a need to verify a file attached using the file attachment control. &amp;nbsp;How can I capture the file path of a file attached through a file attachment control?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="pBody postableBody"&gt;Can I do this by stripping the file name and location from the Attch File control?&amp;nbsp; If not, what about using a file picker?&amp;nbsp; I have not been able to find one.&amp;nbsp; I have been able to identify a file and successfully send it as an attachment through the send mail in vb script.&amp;nbsp; Below is the code with a file hard coded.&amp;nbsp; I really need a file picker though.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span class="pBody postableBody"&gt;&amp;nbsp; Set Outlook = CreateObject(&amp;quot;Outlook.Application&amp;quot;)&lt;br /&gt;&amp;nbsp; Set Message = Outlook.CreateItem(olMailItem)&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; Set myAttachments = Message.Attachments&lt;br /&gt;&amp;nbsp; myAttachments.Add &amp;quot;C:\temp\Carla.jpg&amp;quot;, olByValue, 1, &amp;quot;Carla.JPG&amp;quot;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp; With Message&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Subject = emailsubject_IS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Body = emailmessage&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Recipients.Add (email_IS)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Recipients.Add (email_ITSRM)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Len(aFrom) &amp;gt; 0 Then .Recipients.Add(aFrom).Type = olOriginator&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Send&lt;br /&gt;&amp;nbsp; End With&lt;/span&gt;&lt;/p&gt;&lt;span class="pBody postableBody"&gt;&amp;nbsp; set message = nothing&lt;br /&gt;&amp;nbsp; set Outlook = nothing &lt;br /&gt;&lt;/span&gt;&lt;span class="pBody postableBody"&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;</description></item></channel></rss>