<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Care, Share and Grow! : MS Office</title><link>http://blogs.msdn.com/saurabh_singh/archive/tags/MS+Office/default.aspx</link><description>Tags: MS Office</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Some Info around WebDAV content access issues</title><link>http://blogs.msdn.com/saurabh_singh/archive/2009/03/07/some-info-around-webdav-content-access-issues.aspx</link><pubDate>Sat, 07 Mar 2009 04:15:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9463718</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/9463718.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=9463718</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=9463718</wfw:comment><description>&lt;p&gt;If you have a Web folder (WebDAV) hosted on IIS using Basic Authentication there are a few things you need to ensure such that any client accessing the resource does not get into failures.  &lt;p&gt;If your WebDAV site is restricted using Basic authentication and you are trying to access it over HTTP, access may fail. Over HTTP it may keep prompting you for authentication or else will show the following error:  &lt;p&gt;&lt;strong&gt;"Internet Explorer could not open http://ComputerName/WebDav as a Web &lt;/strong&gt; &lt;p&gt;&lt;strong&gt;Folder. Would you like to see its default view instead?"&lt;/strong&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4555d3e5097e_556F/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="163" alt="image" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/4555d3e5097e_556F/image_thumb_1.png" width="493" border="0"&gt;&lt;/a&gt;  &lt;p&gt;Windows Vista will fail to connect to the server using Basic authentication which is insecure over the network. Vista/XP requires SSL connection to be used with Basic. However you can connect to the Web folder if you set the following registry key on the client machine to 2.  &lt;p&gt;&lt;em&gt;&lt;strong&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel&lt;/strong&gt;&lt;/em&gt;  &lt;p&gt;The BasicAuthLevel can be set to the following values:  &lt;ul&gt; &lt;li&gt;0 - Basic authentication disabled  &lt;li&gt;1 - Basic authentication enabled for SSL shares only (Default) &lt;li&gt;2 or greater - Basic authentication enabled for SSL shares and for non-SSL shares &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Check this article for more on this &lt;a href="http://support.microsoft.com/kb/Q841215" target="_blank"&gt;Q841215&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Also You may not be able to edit an Office 2007 document from within a Web folder from your client. In such a case ensure the following registry key is set:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Internet\OpenDocumentsReadWriteWhileBrowsing&lt;/em&gt;&lt;/strong&gt; = 1 &lt;p&gt;Refer to this &lt;a href="http://support.microsoft.com/kb/870853" target="_blank"&gt;Q870853&lt;/a&gt; for more around Office 2003/2007. &lt;p&gt;* If you are still having issues editing the Office document ensure that there is no Certificate Security alert or Error when browsing to the same Web folder URL. If you do see a security alert because of any of the three reasons associated with it ensure they are fixed.&amp;nbsp; &lt;p&gt;Also these should be handy for other WebDAV related issues, KB&lt;a title="http://support.microsoft.com/kb/912152" href="http://support.microsoft.com/kb/912152"&gt;912152&lt;/a&gt; and KB&lt;a title="http://support.microsoft.com/kb/900900" href="http://support.microsoft.com/kb/900900"&gt;900900&lt;/a&gt;. &lt;p&gt;&amp;nbsp; &lt;p&gt;Until next time...&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9463718" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/MS+Office/default.aspx">MS Office</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/WebDAV/default.aspx">WebDAV</category></item><item><title>Unable to correctly display Chinese (Unicode) characters in Excel when opened through ASP.Net page</title><link>http://blogs.msdn.com/saurabh_singh/archive/2008/02/27/unable-to-correctly-display-chinese-unicode-characters-in-excel-when-opened-through-asp-net-page.aspx</link><pubDate>Wed, 27 Feb 2008 04:12:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7912250</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/7912250.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=7912250</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=7912250</wfw:comment><description>&lt;p&gt;Recently I was working on an issue wherein one of our customers was trying to stream data from their web application in CSV format for it to be recognizable and opened through Excel on the client's end. Basically they were setting content-type and content-disposition to open the file outside the browser and open it in MS-Excel. Everything would have worked had they not used Chinese characters as data in this case.&lt;/p&gt; &lt;p&gt;Something like this: &lt;/p&gt; &lt;p&gt;Page.Response.Clear()&lt;br&gt;Page.Response.ContentType = "application/vnd.ms-excel"&lt;br&gt;Page.Response.ContentEncoding = System.Text.Encoding.UTF8&lt;br&gt;Page.Response.AddHeader("Content-Disposition", "attachment; filename=ExportData.xls")&lt;/p&gt; &lt;p&gt;And later in the code they were reading the column headers and column row in CSV format into a string which will get flushed as a response output.&lt;/p&gt; &lt;p&gt;Something like this: &lt;/p&gt; &lt;p&gt;'Output Column Headers as&amp;nbsp; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnHeaders = "HEADER1" + Chr(9) + "HEADER2"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnHeaders = columnHeaders &amp;amp; Chr(13) &amp;amp; Chr(10) &lt;p&gt;[Here, Chr(9), Chr(10) and Chr(13) correspond to Tab, Linefeed and Carriage Return characters in ASCII respectively to adhere to CSV format]&lt;/p&gt; &lt;p&gt;Page.Response.Write(columnHeaders)&lt;br&gt;Page.Response.Write(Chr(10)) &lt;p&gt;and &lt;p&gt;'Output Column Row as&lt;br&gt;columnRow = "" &lt;p&gt;After populating the columns in various strings we do this to adhere to CSV format: &lt;p&gt;columnRow = coulmn1 + Chr(9) + column2 &lt;p&gt;columnRow = columnRow &amp;amp; Chr(13) &amp;amp; Chr(10) &lt;p&gt;............... &lt;p&gt;Page.Response.Write(columnRow)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Finally display the data &lt;p&gt;Now if you see above this should work if we try to open the file using Excel. Although if we are sending the data in UTF-8 encoding (let's say for Chinese characters), Excel doesn't recognize it correctly and opens it in ASCII. In normal scenarios the above functionality will not cause issues but if we are using any Unicode characters like Chinese the data will be wrongly displayed in Excel. You may see "???????" etc. Although it may display perfectly fine in the webpage control , let's say in a datagrid. &lt;p&gt;The resolution to such an issue is to switch from UTF-8 to Unicode and add Unicode byte leader &lt;br&gt;to the start of the file. Excel will recognize the byte-leader as an indication of Unicode data coming in, and correctly read the file as Unicode. This way Unicode characters like Chinese can be preserved when opened through Excel. &lt;p&gt;Here is something you can try: &lt;blockquote&gt; &lt;p&gt;Dim rgByteLeader(1) As Byte&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rgByteLeader(0) = &amp;amp;HFF&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rgByteLeader(1) = &amp;amp;HFE&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.Clear()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.ContentType = "application/vnd.ms-excel"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.ContentEncoding = System.Text.Encoding.Unicode&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.AddHeader("Content-Disposition", "attachment; filename=ExportData.xls")&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;' Write out the Unicode header FFFE so that Excel recognizes the file as Unicode()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.BinaryWrite(rgByteLeader)&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;'Output Column Headers as before &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnHeaders = "HEADER1" + Chr(9) + "HEADER2"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnHeaders = columnHeaders &amp;amp; Chr(13) &amp;amp; Chr(10)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.Write(columnHeaders)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.Write(Chr(10))&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;'Output Column Rows as before&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnRow = ""&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .............&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnRow = coulmn1 + Chr(9) + column2 &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columnRow = columnRow &amp;amp; Chr(13) &amp;amp; Chr(10)  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.Write(columnRow)&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Page.Response.End()&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I am no Globalization/MS-Excel expert but I had a tough time researching on this issue so thought of sharing it with others. Hope this helps!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7912250" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/MS+Office/default.aspx">MS Office</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/Globalization/default.aspx">Globalization</category></item><item><title>IE, Office 2003 and Office 2007 behavior to save a file with characters like []</title><link>http://blogs.msdn.com/saurabh_singh/archive/2007/07/03/ie-office-2003-and-office-2007-behavior-to-save-a-file-with-characters-like.aspx</link><pubDate>Tue, 03 Jul 2007 05:49:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3666335</guid><dc:creator>Saurabh Singh</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/saurabh_singh/comments/3666335.aspx</comments><wfw:commentRss>http://blogs.msdn.com/saurabh_singh/commentrss.aspx?PostID=3666335</wfw:commentRss><wfw:comment>http://blogs.msdn.com/saurabh_singh/rsscomments.aspx?PostID=3666335</wfw:comment><description>&lt;p&gt;Recently&amp;nbsp;I came across an issue where&amp;nbsp;one of&amp;nbsp;our&amp;nbsp;customers wanted to open a file from the website and, when they get an Open/Save pop up they should click on Open and then once the file is open in Microsoft Excel 2003,&amp;nbsp;should be able to save it with the original name as provided&amp;nbsp;in the code.&lt;/p&gt; &lt;p&gt;Here is the code they were using:&lt;/p&gt; &lt;p&gt;&lt;u&gt;Default.aspx&lt;/u&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup='true' %&amp;gt;&lt;br&gt;&amp;lt;html&amp;gt; &lt;/em&gt; &lt;p&gt;&lt;em&gt;&amp;lt;script runat='server'&amp;gt;&lt;br&gt;protected void Page_Load(object sender, EventArgs e)&lt;br&gt;{&lt;br&gt;Response.Clear();&lt;br&gt;Response.ClearHeaders();&lt;br&gt;Response.ClearContent(); &lt;/em&gt; &lt;p&gt;&lt;em&gt;Response.Buffer = true;&lt;br&gt;Response.ContentType = "application/vnd.ms-excel";&lt;br&gt;Response.AppendHeader("Content-Disposition", "&lt;strong&gt;attachment&lt;/strong&gt;; filename=&lt;strong&gt;filename1.csv&lt;/strong&gt;"); &lt;/em&gt; &lt;p&gt;&lt;em&gt;Response.Write("a,b,c,d\n1,2,3,4\n");&lt;br&gt;Response.End();&lt;br&gt;} &lt;br&gt;&amp;lt;/script&amp;gt;&lt;br&gt;&amp;lt;/html&amp;gt;&lt;/em&gt;  &lt;p&gt;Now here is the problem. We are able to open the file in Excel 2003. Now once the file is open and&amp;nbsp;if you try to save this file by&amp;nbsp;clicking on File-&amp;gt;Save/Save As, you will get an error (provided you don't&amp;nbsp;remove the special character like "["&amp;nbsp;in the filename).  &lt;p&gt;Here are the screenshots when I access the page.  &lt;p&gt;&amp;nbsp;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b55ec1b8fcea_47EB/image03.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="194" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b55ec1b8fcea_47EB/image0_thumb1.png" width="290" border="0"&gt;&lt;/a&gt;Fig 1&lt;/p&gt; &lt;p&gt;I click on Open. Now once the Excel file is open, try to save it&amp;nbsp;without changing the name (you can change the location though)&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b55ec1b8fcea_47EB/image012.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="201" src="http://blogs.msdn.com/blogfiles/saurabh_singh/WindowsLiveWriter/b55ec1b8fcea_47EB/image0_thumb8.png" width="595" border="0"&gt;&lt;/a&gt; Fig 2&lt;/p&gt; &lt;p&gt;So you see the file cannot be saved because it contains the character "[]" in it. The name that it will try to&amp;nbsp;save is filename1[1].csv.&lt;/p&gt; &lt;p&gt;This happens because IE stores the file&amp;nbsp;on the client machine&amp;nbsp;in the location C:\Documents and Settings\&amp;lt;profile&amp;gt;\Local Settings\Temporary Internet Files\Content.IE5\5N4G3UBL (some random value). The filename will be filename1[1].csv. IE automatically adds&amp;nbsp;a version subscript by default.&lt;/p&gt; &lt;p&gt;If you try to access the same&amp;nbsp;page from a machine which has Microsoft Office 2007, you will not encounter this issue. Reason being that Office 2007 is modified to use a parentheses (&lt;strong&gt;"( )"&lt;/strong&gt;) instead of square brackets ("&lt;strong&gt;[ ]&lt;/strong&gt;") while saving the file. And since parentheses is not a part of the above restricted set as in Fig 2 we can save the file. &lt;/p&gt; &lt;p&gt;So as you see here, both IE and Microsoft Office 2003 are partially at faults. IE, because it adds the [] to the file name when saving&amp;nbsp;it to temporary internet files folder and Microsoft Office 2003, because it cannot save&amp;nbsp;a file with special characters like [ or ] in it. Office 2007 while saving the file uses parentheses and not square brackets. So there won't be a problem when client has&amp;nbsp; Microsoft Office 2007 installed. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3666335" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/IE/default.aspx">IE</category><category domain="http://blogs.msdn.com/saurabh_singh/archive/tags/MS+Office/default.aspx">MS Office</category></item></channel></rss>