<?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>Re: Accessing a .txt file that is a resource file.</title><link>https://www.infopathdev.com:443/forums/thread/77238.aspx</link><pubDate>Fri, 06 Apr 2012 18:56:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:77238</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/77238.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=77238</wfw:commentRss><description>&lt;p&gt;Assuming this is not a browser form, you should be able to use a button and a SaveFileDialog - more at this link:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.windows.forms.savefiledialog.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Accessing a .txt file that is a resource file.</title><link>https://www.infopathdev.com:443/forums/thread/77237.aspx</link><pubDate>Fri, 06 Apr 2012 18:45:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:77237</guid><dc:creator>Lockdown</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/77237.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=77237</wfw:commentRss><description>&lt;p&gt;Thanks Hilary! Thats what I was looking for. &lt;/p&gt;
&lt;p&gt;I want to just open it then write to an output file that the user can save on their computer. I can do it without a prompt, but I will be looking into getting a save prompt to come up so they can name it and save it. &lt;/p&gt;
&lt;p&gt;This is definitely a start. Thanks again.&lt;/p&gt;</description></item><item><title>Re: Accessing a .txt file that is a resource file.</title><link>https://www.infopathdev.com:443/forums/thread/77235.aspx</link><pubDate>Fri, 06 Apr 2012 18:35:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:77235</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/77235.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=77235</wfw:commentRss><description>&lt;p&gt;Oh, I see - I think you are asking if it is possible to change the &lt;em&gt;&lt;strong&gt;contents&lt;/strong&gt;&lt;/em&gt; of a resource file in a form template programatically?&lt;/p&gt;
&lt;p&gt;You can access the file, but I don&amp;#39;t think you&amp;#39;ll be able to save the changes - you&amp;#39;d have to save the template as source files, and update the file, then repack it up.&lt;/p&gt;
&lt;p&gt;It sounds like your current approach of accessing the files from their network location may be the correct way to go here.&lt;/p&gt;
&lt;p&gt;To open a resource file that is part of your template (MSDN &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.formtemplate.openfilefrompackage(v=office.11).aspx"&gt;link&lt;/a&gt;):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Template.OpenFileFromPackage(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;FileName.txt&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;</description></item><item><title>Re: Accessing a .txt file that is a resource file.</title><link>https://www.infopathdev.com:443/forums/thread/77234.aspx</link><pubDate>Fri, 06 Apr 2012 18:26:37 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:77234</guid><dc:creator>Lockdown</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/77234.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=77234</wfw:commentRss><description>&lt;p&gt;The text files are already in place and quite lengthy. They will change frequently so I think it would be best to just be able to update the resource file with the new versions. I tried adding it as a resource file but wasn&amp;#39;t too sure what to use for the pathname in the code.&lt;/p&gt;
&lt;p&gt;As of now I am just using the name of the file since I figured if it is part of the template, that should be enough to access it.&lt;/p&gt;</description></item><item><title>Re: Accessing a .txt file that is a resource file.</title><link>https://www.infopathdev.com:443/forums/thread/77233.aspx</link><pubDate>Fri, 06 Apr 2012 18:21:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:77233</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/77233.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=77233</wfw:commentRss><description>&lt;p&gt;So the text file doesn&amp;#39;t change? Once you add it as a resource to the form, you&amp;#39;d need to update the file in the template if it had any changes.... &lt;/p&gt;
&lt;p&gt;Any reason you&amp;#39;d not use an XML file and create a data connection to it? Then you may not have to use code at all...&lt;/p&gt;</description></item><item><title>Accessing a .txt file that is a resource file.</title><link>https://www.infopathdev.com:443/forums/thread/77232.aspx</link><pubDate>Fri, 06 Apr 2012 18:07:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:77232</guid><dc:creator>Lockdown</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/77232.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=77232</wfw:commentRss><description>&lt;p&gt;Is there a way to use code to access a txt file that is a resource file for a form. &lt;/p&gt;
&lt;p&gt;If not, is there a better way that I should be doing this?&lt;/p&gt;
&lt;p&gt;I need to read in a txt file, parse it, and then allow a user to save the finished product. &lt;/p&gt;
&lt;p&gt;I am able to read in the file from a network location but I&amp;#39;d much rather have the txt file as a part of the form in one way or another. &lt;/p&gt;
&lt;p&gt;Any suggestions would be greatly appreciated!&lt;/p&gt;</description></item></channel></rss>