Friday, August 29, 2008

Some files can harm your computer. If the file information looks suspicious or you do not fully trust the source, do not open the file.

Creating new document based on SharePoint templates you often get the error:

Some files can harm your computer. If the file information looks suspicious or you do not fully trust the source, do not open the file.


SharePoint uses the ActiveXObject from the browser, SharePoint.OpenDocuments, and invokes the function CreateNewDocument (or CreateNewDocument2 in MOSS 2007) with the location of the template (http://...) and the default save location (set to the current folder).

This blog describes how to fix the issue.

However, this didn't change anything for me. Instead I checked out the htmltransinfo.xml file found in "c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML". Notice HandlerUrl - and also notice that when opening Word documents directly from SharePoint these errors doesn't occur. Didn't change anything either.

Some claims running Office Diagnostics solves the issue - haven't got time to try out this model - yet!

Tried it - no luck :-(

Thursday, August 28, 2008

Application Event Log: Unable to connect publishing custom string handler for output caching.

We often get the following error in the eventlog on the SharePoint IIS Server:
Unable to connect publishing custom string handler for output caching.
It would be excellent to learn how to avoid this issue.

Googling the issue many refers to modifying web.config and either add or remove entries to the httpModule section.

But what works? You tell me.

This blog most likely gives a great explanation of the issue. In SharePoint 2003 you had the concept of managed paths - so if you had other web applications on the server you needed to specify these explicit. In MOSS 2007 this feature is removed from the administration tool - and the above blog indicates that it should be added directly in web.config.

Saturday, August 16, 2008

Create a DOCX programmatically

This blog provides a simple example on how to create an Office 2007 docx document.

Monday, August 11, 2008

Web part import - zoneIndex doesn't work

If you have ever tried to import web parts using SPLimitedWebPartManager AddWebPart you'll notice the zoneIndex parameter.

Unfortunately it turns out that zoneIndex only works if web parts are imported in sequence - so you'll need to make certain import is done in the proper sequence order.

After import zoneIndex cannot be modified programmatically - at least I've not found a way to do this.

Saturday, August 02, 2008

Adding a contenttype to a list using Office

Today I learned that it's possible to add a content type to a list using Word. Facinating feature! It's even possible for users not allowed to administer the list to add a content type.

How is this done.


  • Open a Word dokument from another list with the content type you wish to use

  • Save the Word dokument to the new list

Voila - missing accomplished.

The way Office and SharePoint support this feature is through the ContentTypeId property found in Word as outlined below.

The contenttypeid is a guid: 0x01010E00B369AA1A2937544FB28BC321A473DF5A00BCFEABD7F057124C9046012A9BA89F62.

As SharePoint runs promote/demote document properties the content type id is added to the list. I wonder what happens when documents are sent between organisations - will probably be quite messy!