January 2005 - Posts

Setting MySite as Office Default WebSite
25 January 05 03:03 PM | madsn | with no comments

My experience is that frustration usually leads to salvation, this took me two days and lead to a 90% solution and explanation.

Day 1

I just reinstalled all my software, thus the My Site link in Office save open dialogs disappeared. No problem I thought and went to MySite to click the "Set as Office default website" link. Well, it did not show, so I created a custom link with a content editor webpart to be able to call the script "setPersonalSite()".

This had no effect. By examining the script I found that an ActiveX control called PortalConnect.PersonalSite was involved. Because I'd tried just about everything to disable security (yeah, I just installed Windows XP SP2) on all levels I figured I could try calling the component directly from managed code through COM Interop.

No luck here either. A COMException of the unknown type blessed my console application which left me kind of blank. More research lead me to the assumed functionality of this code, which is in fact simply setting a registry entry (go figure). The key in question is

HKCU\Software\Microsoft\Office\11.0\Common\Open Find\Places\UserDefinedPlaces\PersonalSite

From there you'd think it would be smooth sailing, but no. The actual path to mysite is stored as a Pidl (Pointer to ID List) which is not even close to be accessible for strictly managed coders like myself. I spent some time staring on this, and this, and this, and this without beeing able to do

1. Manipulate the binary array in managed code from the RegistryKey.GetValue("Pidl") method
2. Calling unmanaged code to manipulate the path section of the damn Pidl

Day 2

Clarity appeared during the night. I managed to figure out that the ActiveX component actually didn't create the Pidl and SortAcending values on the PersonalSite key, but actually writes a Name and Path key, both strings. The first time an Office Open or Save dialog opens the path key is converted to a Pidl automatically. Thus changing the MySite link in Office can be done by deleting the Pidl and SortAscending values and inserting a Path string with another url. Click Open in Office and it's converted.

The second part of the problem was that I was unable to open MySite as a Web Folder (IE -> File -> Open -> tickbox). After examining log my Local Settings\Temp directory I found some guidance in the wecerr.txt logfile indicating something wrong in the response from IIS:

HTTP 0 The Web server, or a proxy server, returned a badly-formed HTTP response.  Please notify the Webmaster for the server.

I had a feel this was related to security somehow to I retried something I was certain to have tried before: re-adding the portal url to Trusted Sites. I found that the url listed was on the http protocol, not https as we use. I changed this and reverted security settings for Trusted Sites to default level.

Then I went along and deleted the PersonalSite registry key which prompted MySite to display the "Set as Office default website" on page load.

Click Yes -> Fixed!

However, I tried the same approach on another machine and the procedure was successful all the way to actually opening the MySite from File Open. On this machine MySite was still not opening as a Web Folder with the same error logged in wecerr.txt file. Currently we see a couple of possible reasons; Microsoft AntiSpyware might have mixed it up or due to that extensive customization to the MySite in question.

Updates will come if we resolve this issue aswell.

 

Filed under:
Importing from Excel to Sharepoint lists
19 January 05 09:29 AM | madsn | 2 comment(s)

I didn't really expect too much from this feature, but yesterday I had to move a large Excel file to a Sharepoint list and gave it a real try. After several attempts on the "Import Spreadsheet" I forfitted and created the list definition manually and copied in the values column by column from the source sheet.

Later on in the evening I picked up Microsoft .NET Development for Microsoft Office (yes, from Microsoft Press) and started to read about Excel interop. In the book they describe how OLEDB determines columnt datatype through type-guessing. Appearantly, by default, OLEDB uses the first eight rows to determine the type of the column, not the cell data type as I persumed. The number of rows used to guess the data type is specified in the registry key HKLM\Software\Microsoft\Jet\4.0\Engines\Excel\TypeGuessRows.

I found that Sharepoint does not use this typeguessing feature to determine the datatype for list columns. Sharepoint seems to use a safer approach that will fall back to either Single or Multiple lines of text if any cell in the column breaks the pattern.

Excel 2003 will also give you SmartTag validation warnings if you're opening an old Excel Workbook that contains date values in a string column or the like. In other words the datatype for the cells in Excel matter, because they will cause validation messages, but you need to clean the Excel data before importing them if you want to get the Sharepoint-list right. I'd also recommend you to select the excact cell-range when importing to avoid including some one-char strings in surrounding cells that might mess up the import.

Filed under:
More on email and Document Libraries
16 January 05 05:48 PM | madsn | with no comments

I get a lot of mail from people trying to find good solutions for handling mail with Sharepoint. The alternatives are pretty in the open as described in my previous posts, but Rob Clark found another twist to the issue.

Rob started out experimenting with the mail-enabled document libraries and quickly discovered that only attachements emailed into the public folders were picked up by the SPS crawler. Files placed directly into the public folder stays put. This forced him to discard the approach and Rob solved it by using the Explorer view of the document library.

Doing this is acheives the same as the IE trick, and it makes it possible to drag and drop entire file structures into the document libraries, from disk or Exchange. Another bonus, Rob points out, is that you can drag in shortcuts to Outlook calendars and such aswell. The headache in using this approach is that any filenames with funny characters like the ampersand (and I persume also extended unicode like norwegian ÆØÅ characters which have caused problems before) will make the copying fail.

The interesting thing about this is that people seem to find all kinds of ways to work around existing weaknesses in Sharepoint. This will prove a challenge for Microsoft in designing SPS v.Next, to accomodate the different habits users get through these alternatives. A great solution for some might be unacceptable for others.

 

 

Filed under:
Some changes on the new year
13 January 05 04:27 PM | madsn | 1 comment(s)

Entering the new year my colleague Anders inspired me to join the crowd of good samaritans. A task postponed far too long. Suffering from severe cruft I formatted my box and started out with clean sheets. This gave me the opportunity to start developing with least privelige and also installing Cassini for a lighter ASP.NET experience. I'm also finally starting up with VS.NET 2005 for real.

In the process of (re)installing all my stuff I started reading the Pragmatic Programmer, and I realized how many bad habits I'd collected during 2004. I guess I'm going to make this a tradition.

Still I feel a bit beaten up (Fight Club style) by the entire process, but I guess it's good for me:-)

More Posts

This Blog

<a name="MyWork">!My work!</a>

Funstuff

Goodies

MSCRM Blogs

Sharepoint

Useful reading

Weblogs

Syndication