Twospeakers at the user group meeting last night. The first session was an eye opener for me, one of those ‘thoughts crystalising’ moments. Continue reading “SharePoint UK User Group last week”
Author: Andy Burns
Internet Explorer can't open a new document in Library
Curious problem – I kept getting an error message “Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience.” whenever I tried to open a document from our internal MOSS system. Strange.
Eventually figured it out from Geekette’s Blogette, and kbAlertz 833714.
We use Project 2003 still. This means two version of the owssupp.dll, apparently, under c:program filesMicrosoft Officeoffice11 and office12
I followed the advice from the MS Knowledgebase article, but got the same error as all the folks at kbAlertz. In the end I tried just uninstalling MS Project Professional 2003 support – and low, Internet Explorer started letting me open documents from MOSS again. And, much to my surprise, Project 2003 web access works just fine – I guess it doesn’t use that dll.
Add an event handler
I keep using this snippet of code:
if( window.addEventListener ) {
window.addEventListener("load", fn, false );
} else if( window.attachEvent ) {
window.attachEvent("onload", fn );
}
It’s just a tidier way of attaching a function ‘fn’ to an event. It also allows multiple handlers per event. There could be another ‘else’ where we just assign the function to an event (e.g. window.onload = fn ) but that would only support one handler per event.
The registry and "Word could not create work file"
I had an interesting problem earlier this week. I had a MOSS VM that seemed to work okay, except whenever I tried to create a document using the template on a Document Library. Then I would get the error:
Word could not create work file. Check the temp environment variable.
Okay. So I did – and the temp variable was just fine. Odd, I thought. Eventually, after digging through news groups and so on, I found a suggestion to check parts of the registry. Well, actually, one of my colleagues found it. The value in the key
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folderscache
was wrong – it pointed to an invalid directory. Not sure why, but I’d been monkeying around with some stuff which could’ve mucked it up. Anyway, fixed up the filepath in that key, and it was fine – I could create documents from Document Library templates.
SharePoint Folders Ending in _FILE
Here’s an interesting thing a colleague noticed – SharePoint folders with names ending in _FILE are renamed to end in _FILE_. In the image below the names and titles were the same when I typed them in:

Notice the line for A_FILE. Name and title are now different. No idea why that happens. I’m guessing that SharePoint uses folders with a suffix of _FILE for it’s own internal stuff… ![]()
Joel Oleson and Disk allocation in SharePoint
Was just asked about this and Joel’s post made my day much easier. What discs in what configuration is an important subject for any server – there’s plenty of performance to gain here for fairly little effort.
SharePoint Skinner
Themes in SharePoint are tough. I think this quote describes it nicely:
If you have attempted to override the styles on an out of the box SharePoint site, you know that it isn’t a very easy thing to do. The core.css file that contains the basic rules has 979 different style rules.
The core.css file uses a palette of 132 colors and 143 images.
The default page of a newly provisioned team site uses only 61 of those rules.
So, unless you have branded a lot of SharePoint sites and are intimately familiar with core.css and the default master pages and page layouts, just figuring out where to start modifying can be a daunting task.
So Doug has built SharePoint Skinner to make that easier. I’ve not tried it (yet) but I like his thinking…
Workflow Correlation tokens
I just found a post where someone had gotten confused about tokens in MOSS workflow:
- Workflow Correlation Tokens are used to identify the Workflow an event should be routed to.
- Task Correlation Tokens are used to identify the Task in the workflow the event is about.
- Each task must have its own token.
- A workflow token should never be used with a Task.
Error: The event receiver context for Workflow is invalid
This is an obscure error:
Error in commiting pending workflow batch items: System.InvalidOperationException: The event receiver context for Workflow is invalid.
at Microsoft.SharePoint.SPEventReceiverDefinition.ValidContext()
at Microsoft.SharePoint.SPEventReceiverDefinition.ValidReceiverFields()
at Microsoft.SharePoint.SPEventReceiverDefinition.
GetSqlCommandToAddEventReceivers(IList`1 erds)
at Microsoft.SharePoint.Workflow.SPWinOESubscriptionService.
CommitNewSubscriptions(Transaction txn, IList`1 erds)
at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.
ProcessWorkItemBatch(Transaction transaction, Work method, IList`1 workItemBatch)
at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.
Commit(Transaction transaction, ICollection items)
Let’s skip over wondering what an erd is (event receiver definition maybe?)- the solution to this is simple, but not obvious. Check you have created properties for TaskID, TaskProperties and Correlation Token. I found this solution at Robert Bogue’s blog. As a side note it is a REAL pain in the ass that setting up TaskIDs and TaskProperties is so manual – or at the very least that tasks with unassigned values for these do not appear with the red ‘warning’ exclamation mark in Visual Studio.
Adding Snippets in Visual Studio
I keep forgetting how to do this, and have to do so every time I want to create a new SharePoint workflow.
- Open Visual Studio.
- Right click on toolbars and ‘Customize’
- Click ‘Commands’ Tab.
- Click on the ‘Tools’ category.
- Add the ‘Code Snippets Manager’.
- Add ‘C:Program FilesMicrosoft Visual Studio 8Xml1033SnippetsSharePoint Server Workflow’ to your snippets
- It should be straight forward from there…
Comments from my old blog:
Are you using your own project templates? I’m curious because using the MOSS Workflow Project templates (both state machine and sequential)–the templates that come with the MOSS SDK–and I have the snippets already available to me.
Anyway, just throwing that out there.
Nope, these are the ones out of the SDK. I’m not clear why, but in some VMs that I use the snippets aren’t immediately available after I install it. And normally the ‘Code Snippets Manager’ is already available too – but not always. I haven’t figured out what factor causes these things to occur
But yes Peter, you’re right – normally they should be available.