<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Overriding the Default Save Location</title><link>https://www.infopathdev.com:443/forums/thread/7889.aspx</link><pubDate>Wed, 12 Oct 2005 23:57:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:7889</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/7889.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=7889</wfw:commentRss><description>Hi Reg,&lt;br /&gt;Great question. I have no idea but I suspect that you may be able to get the USERPROFILE environment variable using System.Environment. USERPROFILE points to the My Documents folder. This will probably require special Environment permissions, though.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Overriding the Default Save Location</title><link>https://www.infopathdev.com:443/forums/thread/4980.aspx</link><pubDate>Tue, 11 Oct 2005 01:08:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4980</guid><dc:creator>rjohnson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4980.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=4980</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;When loading a form from a saved XML, I want the user to start the default save location from the My Documents. I know this is the default behaviour when loading an XSN, but I also want this occur when loading an XML. By default, when I load an XML from the hard drive, or a submitted e-mail, it defaults the save location to where the XML was loaded.&lt;br /&gt;&lt;br /&gt;I've recently noticed that you can override how the save occurs in InfoPath using the OnSaveRequest function.&lt;br /&gt;&lt;br /&gt;However, I wanted to know the flexibility of it, when the form is &lt;b&gt;not fully trusted&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;I want the form to start the saveDialogLocation from the My Documents, but am not sure what to type.&lt;br /&gt;I can't hard code the My Documents directory such as, XDocument.UI.SetSaveAsDialogLocation("C:\\USER Profile\My Documents"),&lt;br /&gt;for 2 reasons:&lt;br /&gt;1) I don't know what user is on.&lt;br /&gt;2) The My Documents changes if there is a network connection or not.&lt;br /&gt;&lt;br /&gt;I've noticed that if you write a directory that doesn't exists, such as XDocument.UI.SetSaveAsDialogLocation("z:\NotThere"), it automatically reroutes back to the My Documents, so I assume there should be a way to tell InfoPath to go to the My Documents, without placing a non-existant directory.&lt;br /&gt;&lt;br /&gt;If I don't place anything inside the quotes, such as  XDocument.UI.SetSaveAsDialogLocation(""), it defaults the save location to the area where the xml was loaded.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Is there a simple variable that I can use, that will always use the My Documents?&lt;/b&gt;&lt;br /&gt;eg: XDocument.UI.SetSaveAsDialogLocation("\\MyDocuments") ?&lt;br /&gt;&lt;br /&gt;As always,&lt;br /&gt;any help would be appreciated.&lt;br /&gt;&lt;br /&gt;- Reg</description></item></channel></rss>