Posted tagged ‘Workaround’

Updating Content Editor Content with Word

May 19, 2009

There are a number of reasons why users might be using content editors for page content in a SharePoint site. However this creates a fair amount of overhead when users can’t get the content to ‘look just right’. Often without HTML edit abilities users become frustrated and will give up or push content out that has been akwardly formatted.

One of the ways you might try out to help with these kinds of issues is getting users to modify and update content editor content in word. I am going to go through how this can be done (relatively easily) in a few steps here. The important steps in the process is creating an HTML document (in this case I am using word, but you could use SharePoint Designer, or any product which pushes out HTML) and then getting the content editor webpart to reference the HTML document.

  1. First let’s create our web page content in word. It’s important to keep the size of the webpart in mind when we build the content and users MUST insert images as links (from the SharePoint site or internet) as embedded images won’t display. Here is an article on this: http://blogs.msdn.com/ecm/archive/2006/11/17/converting-office-2007-openxml-documents-with-embedded-images-to-sharepoint-web-pages.aspx *Note we are doing a process similar to smart client authoring/conversion. We are just doing it more manual for greater control/flexability.
  2. Save the word document as the HTML/HTM file type. You can do this simply by choosing SAVE AS and saving it under the HTML file type.
    SaveAsHTML
  3. Next we need to upload our HTML (or HTM) file to a SharePoint library.
  4. Navigate to the page you want the content to be displayed on and add a new content editor webpart.
  5. Now let’s edit the newly added content editor webpart’s properties. Namely the Content Link property and set that to reference the HTML or HTM file we just added. To do this you can right click the link in the document library and click copy shortcut and then paste the shortcut into the content link field.
    SaveShortCut
    ContentEditorContentLink
  6. Click OK and save the edited properties.
  7. Voila we should now see the content (built in word) showing on our webpage through the content editor. If we want to modify the content we just need to open the document in word, make our changes and save it to the server. Immediately updating the content on the webpart.

There are two advantages to using a process like this:

  1. You get content version history and version control. Normal webparts don’t really have version control, so by using a document libraries content like this we can enable versioning and go back to previous versions in case something mucks up.
  2. Any user with access to the content can change it just like a word document (more or less) making it require far less training and effort for people to update than the typical SharePoint methods that can cause alot of confusion.

Hope this helps someone who wants to use document conversion for SharePoint but needs a more flexable model for page content,
Richard Harbridge

Name.dll Prompt in IE 7 Fix (Feature, and Easy Deployment)

December 1, 2008

Great news! Ever receive that name.dll prompt on a SharePoint site of yours when viewing in IE 7?

This issue occurs if the Name ActiveX control (Name.dll) is not added to the list of preapproved controls in Internet Explorer 7. The Name ActiveX control is included in the 2007 Microsoft Office system. http://support.microsoft.com/default.aspx/kb/931509

The way to fix it? They have 3 ways, add the site to trusted sites, change the registry, or modify each master page.

Typically option 3 is most appealing. (Quick note, make sure you comment all function lines in their example, it is wrong and if you don’t will result in a js error.) However it has a significant drawback. Imagine how much effort it would take to update hundreds of site collections with many customized master pages?

The good news is that just a short time ago Larry J. Riemann wrote a terrific feature for codeplex based off of Randy Drisgill’s workaround (in response to issues people were having): http://blog.drisgill.com/2007/09/fixing-namedll-activex-problem-mossman.html

The feature (which makes me happy) is located here: http://www.codeplex.com/SPAXO

What is great about this feature is that it is scoped to the web application level so the number of site collections, and sub sites don’t matter. What’s more the way it’s designed should not be effected by any customizations or the number of master pages. Making it a very appealing resolution.

Find out more about the codeplex activex override at Larry’s blog here: http://lriemann.blogspot.com/2008/11/sharepoint-activex-override-module.html

Warning: Through testing this feature I have noticed it causes critical errors when using InfoPath Form Services.

Thank you Randy and Larry we all appreciate it,
Richard Harbridge

Calculated Column Dynamically Updated (When using [Today])

October 3, 2008

Today I was asked a fairly common question that everyone who uses calculated columns eventually runs into. “How do you get a column to calculate automatically when using a reference for a date, or something that dynamically changes like [Today]?” Out of the box this isn’t available because the calculated columns ONLY calculate when an item is updated.

The solution is simple, you write a custom solution that updates all items as desired. So this could be something that runs daily or every time you view the data (using a dashboard). You could even write the code so it adds and removes the column instead of iterating through the items. Do some performance testing to see which is faster in your case.

A terrific Article was posted by Dink that answers exactly how to do it too with free samples: http://www.sharepointblogs.com/dez/archive/2008/07/31/dynamically-updating-a-sharepoint-calculated-column-containing-a-quot-today-quot-reference.aspx

There is also a post here by Chris where he uses the DataView and JavaScript: http://pathtosharepoint.wordpress.com/2008/08/25/a-countdown-for-tasks-lists/

Hopefully this helps someone out,
Richard Harbridge

Total Calculated Columns in SharePoint

July 22, 2008

Out of the box SharePoint does not allow you to create totals in a SharePoint view for calculated columns or calculated fields.

Here is a work-around to total a SharePoint Calculated Columns or the Calculated Fields. (Note this will also create subtotals when using Group By options in a standard list view.)

Let’s say we have a field called PROFIT that is a calculated field set to subtrack the expense field from the revenue field in our list. ([Revenue]-[Expense])

  1. Create a regular number field (or currency field) called TOTAL PROFIT (or any other name you want) in that list.
  2. Using SharePoint Designer create a workflow for your list that runs when list items are created and when list items are changed.
  3. The workflow will have only one step name it something like set TOTAL PROFIT.Leave the condition field blank.
  4. In the action section choose “Set field in the current item”.
  5. Click on the word “field” and choose TOTAL PROFIT (the name of our column).
  6. Click on the word “value” and click on the “fx” button to do a lookup.
  7. Choose “Current Item” for the source.
  8. Choose “PROFIT” for the field. (This is the calculated column.)
  9. Click Finish.

Now whenever someone creates or modified a list item in that list the non-calculated field will automatically be updated with the data from the calculated field.

This means that by adding the TOTAL PROFIT field to any view you can total it and get a sum or any other calculation since you are no longer using a calculated field (directly).

Hope this helps someone,
Richard