Adventures With Office Web Apps

The company for which I am consulting recently had the need to install Microsoft Office Web Apps into their existing SharePoint 2010 farm. in the process of deploying this, I learned quite a few things that I will pass along to those who face this task.

There is an excellent Microsoft TechNet article at http://technet.microsoft.com/en-us/library/ff431687.aspx that explains a lot of the details. I would like to make several points that were crucial in the deployment:

  • When creating the Service Applications, use the ?SharePoint Web Service Default? application pool as described in the TechNet article.
  • Ensure ?SharePoint Web Service Default? application pool account has rights to database content database. In our case, the account was different than the Database Access account and did not have rights to the database. Because of this we received an error when we tried to open in the browser ? ?Word Web App cannot open this document for viewing because of an unexpected error.? After some troubleshooting we discovered this was due to a permission denied in the database of the app pool account.
  • Make sure you activate the ?Office Web Apps? feature on Site Collection. otherwise, you will not know Office Web Apps has been installed.
  • Although .doc and .ppt files can be viewed in the browser, in order to edit them in the browser, they must first be upgraded to the Open Office format ? .docx and .pptx formats respectively. However, . xls files cannot be even viewed in the browser and must be upgraded to .xlsx before they can be used at all.
  • Excel files also take an extra step to view them in the browser – you must make sure to add a “Trusted File Location” in Excel Services Application by navigating to the Central Administration web application –> Application Management –> Manage Service Applications –> Excel Services Application –> Trusted Files Location. You can add a path to the entire site collection, a specific site or a single library. If you are serving the site on http and https, you will need two entries to accomplish this.
  • Also note that if you are requiring Check-out on the library, Office Web Apps will prompt you to inform you that the file must be checked out before it can be edited. The user must perform this task. It will not do it for you!

Microsoft’s Office Web Apps is a very powerful add-in for Microsoft SharePoint Server 2010 and is especially useful in an extranet environment where Microsoft Office versions and Internet Browsers used cannot be controlled. If it is set up properly, the benefits to your organization can be huge.

Posted in Office, PowerShell, SharePoint | Tagged | Leave a comment

Running PowerShell Script from Task Scheduler

There are numerous posts out there about how to execute a PowerShell script from the Task Scheduler in Server 2008. I was unable to get them to work for me, so I wrote a BAT file that kicked off the PS1 and called the BAT file from the task scheduler.

Old skool – I know – but it works. If you have a better solution, feel free to leave comments…Smile

Posted in PowerShell | Tagged , , | Leave a comment

Applying WSS 3.0 SP2 After MOSS 2007 SP2

I know you are thinking that is a crazy title because MOSS 2007 SP2 cannot be applied before WSS 3.0 SP2. Well it can be done! With the original version of MOSS 2007, one was unable to install on the Server 2008 platform without a slipstreamed install version that included at least SP1.

On a recent engagement of mine, the consultants before me had inadvertently installed MOSS 2007 on Windows Server 2008 using a slipstream install that included MOSS 2007 SP2 but not WSS 3.0 SP2. As you can well imagine, the client was experiencing a myriad of issues with this configuration.

If you simply launch the Service Pack executable file,it will automatically unpack the contents and promptly produce a message box stating, “The update is already on this system.” Instead open a command prompt, cd to the directory where the exe resides and executed the file with the /extract: switch to extract the contents of the Service Pack to a location on the Local Hard Disk. For example:

wssv3sp2-kb953338-x64-fullfile-en-us.exe /extract:C:\SP2

This will extract the contents of the Service Pack to C:\SP2. Navigate to C:\SP2 and note that there are three msp files. The last one, wsswwsp2.msp, is a bootstrapper for the other two and is not needed in our situation. Open the first one, stswwsp2.msp, to apply the main SP2 for WSS 3.0. Then open the second one, wssmuisp2-xx-xx.msp, to apply the language pack for your language – mine was en-us or 1033.

After those complete make sure you repeat the process for every server in the SharePoint farm and don’t forget to run the SharePoint Products and Technologies Configuration Wizard to complete the update.

Posted in SharePoint | Tagged , | Leave a comment

Linking to SharePoint 2010 List Forms

The Dilemma

We recently upgraded from Microsoft Office SharePoint Server 2007 to SharePoint Server 2010. All in all it was a very smooth transition. But as in many things in life, we are discovering day by day – week by week some of the interesting quirks of this process.

One such dilemma was that a department here had a Publishing Page with a list of links that presented the user to go directly to a number of NewItem Forms for the various List on that department’s site. For Example…

In 2007 this was a great arrangement as it would link directly to the "New" Form. However, in SharePoint 2010, the forms are presented in a modal AJAX dialog and are not fully functional when called directly. My first instinct was to add the "OnClick" event to the links – following the pattern of the out-of-the-box functionality – except that the Rich Text Editor strips out javascript in the name of security.

The Resolution

The solution was to implement a XMLForm Web part with the data for the links and XSL to tranform the data into a list of links including the OnClick event needed to open the form in a Modal AJAX dialog.

The XML

<?xml version="1.0" encoding="utf-8"?>
<Lists>
  <List Name="Create a new Service Request" ListId="{E1EFFE1C-C77C-4A0B-A479-9705074EC20E}" />
  <List Name="Create a new Event" ListId="{B0F76C5B-0F81-46AA-AAE8-6B9B2850E061}"/>
</Lists>

As you see this is simply a representation of the List Name and the GUID of the ListId. The real magic is in the XSL transformation.

The XSL

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:output method="html" indent="yes"/>
  <xsl:variable name="formLink">../_layouts/listform.aspx?PageType=8&amp;ListId=</xsl:variable>
  <xsl:template match="Lists">
    <ul>
      <xsl:for-each select="List">
        <li>
          <a>
            <xsl:attribute name="href">
              <xsl:value-of select="$formLink" />
              <xsl:value-of select="@ListId" />
            </xsl:attribute>
            <xsl:attribute name="onClick">
              <xsl:text>javascript:NewItem2(event, &quot;</xsl:text>
              <xsl:value-of select="$formLink"/>
              <xsl:value-of select="@ListId" />
              <xsl:text>&amp;RootFolder=&quot;);javascript:return false;</xsl:text>
            </xsl:attribute>
            <xsl:value-of select="@Name"/>
          </a>
        </li>
      </xsl:for-each>
    </ul>
  </xsl:template>
</xsl:stylesheet>

This code loops through the Lists and displays them as an bulleted list. The OnClick event is the key on the <a> tag as it builds the appropriate javascript call to open the New Form in a Modal AJAX Dialog box. This allows you full functionality in the New Form including attaching files – without errors!

Posted in SharePoint | Tagged , , | Leave a comment

Application Was Unable To Start Correctly Error

The Problem

I recently ran across this error when trying to open a PowerPoint deck that I had downloaded from a SharePoint site. My Platform is Windows Server 2008 R2 with Office 2010 installed. When I tried to open the file , I received the following dialog.

Application Was Unable To Start Correctly Screenshot

After clicking OK, I then received the following notification.

Found A Problem With Content In Dialog Screenshot

Clicking Repair was of no help, as it could not repair the file.

The Solution

After some googling, I found out that the source of my problem was that the file, having been downloaded from an internet location, had been blocked by Internet Explorer, the OS or both.

I selected Properties from the context-menu on the file – commonly known as “right-click” and found the dialog box below.

File Properties dialog with "Unblock" highlighted.

By selecting Unblock, the file was able to be opened successfully. While the file in this example is a PowerPoint Presentation, the solution is applicable to all Office Documents.

Posted in Office, SharePoint | Tagged , , | Leave a comment

Using Application Layout with Ruby on Rails

Anyone who is at least cassualy aquainted with the web framework Ruby on Rails, knows how simple it is to develop a simple easy to use interface to a database model. However, I was impressed at how easily one could create an application layout or template of my site that included navigation, headers and footers on each page of the site.

To create an Application Layout in your Rails application, create a file at /path/to/your/application/app/views/layouts/application.html.erb. Put any headers, footers and navigational items and include the code <%= yield %> where you want the controllers to render their content.

Posted in Rails | Tagged , , , | Leave a comment