This post was resting on my unfinished blog list for more than one month now and it is time to finish it. It is also my first SharePoint post (I think 🙂 ).

If you ever tried to open SharePoint document from SharePoint document library and you have Microsoft XP and Office 2003 installed on your machine, you may have discovered that file in SharePoint which you click, to open is always open in “Read Only” mode (read only permission) and you cannot make changes to the document.

If you click on an Office document in SharePoint to open it – it loads it in the relevant application (if you have configured client to open it in the client application), but in Read-Only mode.

In my case I had list of files in Web Application which represented list of SharePoint documents that specific user had permission to Read and Edit. This list was retrieved using custom SharePoint web service which I will cover in my next SharePoint posts (creating custom SharePoint web service).

Because I have tested this Web application using my virtual machine (SharePoint, WSS 3.0) with my computer using Vista and Office 2007 I have received nice pop up message with choice to open file in Read Or Edit mode, like the image below.

SharePoint Document Open Choice

SharePoint Document Open Choice

But what I have learned is that ActiveX which Internet Explorer 6 is using on the machine where you have Office 2003 is not the same as on my Vista machine (with Office 2007 and IE7).

To save document user needed to know which document library filed belongs to and then manually navigate to it. That was not acceptable.

After searching the web I found workaround that should work http://support.microsoft.com/?kbid=870853. According this article:

  1. Quit all running Office 2003 programs.
  2. Open register (regedit.exe)
  3. Locate and then right-click the following registry subkey: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\Internet
  4. Point to New, and then click DWORD Value.
  5. Type OpenDocumentsReadWriteWhileBrowsing, and then press ENTER.
  6. Right-click OpenDocumentsReadWriteWhileBrowsing, and then click Modify.
  7. In the Value data box, type 1, and then click OK.
  8. On the File menu, click Exit to quit Registry Editor.

But, what if you are working in large corporation and you can not so easy push this registry change to all machines?

Or like in my case what if there are some other web based applications that do not permits opening documents in Edit Mode, but just Read Only mode?

And you can not make changes to this applications or even do not have access to those.
So it seems like a dead end, registry fix is needed to fix the problem but you are not allowed to make it or it mess up something else.

There is an workaround to open document from SharePoint in Edit mode.

If you “pull down” menu for the item in the SharePoint document library there is one menu item “Edit In Microsoft Word/Excel,…” like the image bellow.

Edit in Microsoft Word

Edit in Microsoft Word

After clicking on the item you are able to open file in Edit mode!, aha we are close.

There is also some javascript on work here behind the scenes that calls the right function to open the file.

My solution was to open SharePoint document library using Firefox and using the Firebug search for text (in this case) Edit in Microsoft Word.

The result of that search was call to function editDocumentWithProgID2 with correct in arguments for that file. See image bellow.

FireBug Edit in MS Word result

FireBug Edit in MS Word result

After further searching for this function in the SharePoint javascript files on the SharePoint server I found most of the needed functionality in Core.js.

I have extracted function needed to separated file and created simple web application with this reference to this script to test this functionality.
Here is the HTML of the page:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

 <title></title>

 <form id="form2" runat="server">
<div>
 <a href="http://demo-1/blankpage/Newdoclib/fold1/fold2/BLLayer.doc">link to file</a>
 <a href="" onclick="editDocumentWithProgID2('http://demo-1/blankpage/Newdoclib/fold1/fold2/BLLayer.doc', '', 'SharePoint.OpenDocuments', '0', 'http://demo-1/blankpage', '0')">Edit onclick</a></div>
</form>
 <script src="sp.js" type="text/javascript"></script>
 

After testing I was able to open file in the Edit mode without using registry fix.

Main web application was modified to use this script when user clicks on the SharePoint link and all worked like a charm.

Crunched Javascript file needed for this test can be found here.

Advertisements
Posted by: dotnetninja | January 2, 2009

Entering New Year As MCTS WCF 3.5

Congratulations to me 🙂 as I’m entering new year as a MCTS WCF 3.5.
I passed test 30. December. I was prepared with a lot of questions about WCF configuration as I read earlier in Patrik L. blog but those questions was quite simple (maybe because I was really prepared for those).
I was surprised that it was only one question about new System.ServiceModel.Web, i was excepting(read hoping) more about this. Some of the questions was really simple and other harder questions have I tried to answer by elimination method.

Posted by: dotnetninja | November 12, 2008

Second Day in The Barcelona (Tech Ed 2008)

Here are more pictures from Barcelona…, day 2.


Arman In Barcelona

If you can not read it is good to have sign for type of the food 🙂

If you can not read

SQL Data Services

Silverlight
Asp.Net MVC
MVC
SQL Server Compact

Posted by: dotnetninja | November 12, 2008

Hello From Tech Ed 2008

Hi

First day at Tech Ed in Barcelona with long trip from Stockholm, from 03:30 and arrived in Barcelona 13:00.

imag01821

imag01831

imag01841

imag0185

imag0187

imag0188

imag0189

imag0190

imag0191

Posted by: dotnetninja | October 31, 2008

First Look at Microsoft “Oslo”

Just watched PDC session with Douglas Purdy “A Lap around Oslo” and I as was expecting more, I am not disappointed, this is great.

What is then “Oslo” ?

  • M – language for authoring models and DSL
  • QUADRANT – Tool for interacting with models and DSL’s
  • Repository – Database for storing and sharing models

Also as I understod there are four important aspect of “Oslo”.

  • Models
  • Textual DSL
  • Visual DSL
  • Runtime

First demos showed “Intellipad” and how to create an complex type (modell) with M language then converting this model to T-SQL. As sceptist are going to say, there is nothing new here, this could be easily done with any of the text manipulating languages as Ruby, Perl or other. Well yes, there is nothing special here, the special thing is that we are getting an platform to create MODEL DRIVEN APPLICATIONS, that is important!

And cool thing that now you could easily create you own language 🙂

Later demo showing how to create REST service in “just” thirthyeight lines of code with simple syntax and it was running as a WorkFlow Activity. I just LOVE rest oriented architecture…

The code was going something like this:

service FirstService
{
  operation Echo(str:Text):Text
  {
     .UriTemplate ="echo/{str}"; //The same as with WCF REST uritemplate
     WriteLine{ Text = "Message" +str } // WorkFlow
     return str;
 }
 endpoint HttpEndPoint //WCF!
 {
    Binding = WebHttpBinding;
    Adress = "http://localhost:8080/firstservice";
 }

}

Microsoft is also releasing M language specification under OSP.

Posted by: dotnetninja | October 28, 2008

Silverlight Toolkit

Today you can download Sliverlight Toolkit from codeplex.

“The Silverlight Toolkit is a collection of Silverlight controls, components and utilities made available outside the normal Silverlight release cycle. It adds new functionality quickly for designers and developers, and provides the community an efficient way to help shape product development by contributing ideas and bug reports. This first release includes full source code, unit tests, samples and documentation for 12 new controls covering charting, styling, layout, and user input.”

Reblog this post [with Zemanta]
Posted by: dotnetninja | October 27, 2008

Windows Azure Announcement

Great exiting news. Future is here, cloud computing is here (yes we had Amazon services) but with Microsoft entering competition we are going to see many changes as we think, develop, work,…. oo my exiting times are coming 🙂

Watch PDC 2008 keynote http://www.microsoftpdc.com/

After installing Silverlight 2 and Visual Studio Tools for SIlverligt 2, you may receive this errors if you have Blend 2.5 June preview installed.

Blend 2.5 version is not compatible with Visual Studio Tools for Silverlight, so solution for this is:

  1. Uninstall Blend 2.5 June preview.
  2. Install Blend 2 with SP1 (Silverlight).

In some cases you will have to uninstall Visual Studio Tools for Silverlight, Silverlight SDK and Blend 2.5 and install the same again but without Blend 2.5 (just Blend 2 with SP1).

But this solution worked for me.

Posted by: dotnetninja | October 13, 2008

Silverlight 2 Released

Silverlight 2 will be available for download on Tuesday, Oct. 14.

Highlights of new Silverlight 2 features include the following:

.NET Framework support with a rich base class library. This is a compatible subset of the full .NET Framework.
Powerful built-in controls. These include DataGrid, ListBox, Slider, ScrollViewer, Calendar controls and more.
Advanced skinning and templating support. This makes it easy to customize the look and feel of an application.
Deep zoom. This enables unparalleled interactivity and navigation of ultrahigh resolution imagery.
Comprehensive networking support. Out-of-the-box support allows calling REST, WS*/SOAP, POX, RSS and standard HTTP services, enabling users to create applications that easily integrate with existing back-end systems.
Expanded .NET Framework language support. Unlike other runtimes, Silverlight 2 supports a variety of programming languages, including Visual Basic, C#, JavaScript, IronPython and IronRuby, making it easier for developers already familiar with one of these languages to repurpose their existing skill sets.
Advanced content protection. This now includes Silverlight DRM, powered by PlayReady, offering robust content protection for connected Silverlight experiences.
Improved server scalability and expanded advertiser support. This includes new streaming and progressive download capabilities, superior search engine optimization techniques, and next-generation in-stream advertising support.
Vibrant partner ecosystem. Visual Studio Industry Partners such as ComponentOne LLC, Infragistics Inc. and Telerik Inc. are providing products that further enhance developer capabilities when creating Silverlight applications using Visual Studio.
Cross-platform and cross-browser support. This includes support for Mac, Windows and Linux in Firefox, Safari and Windows Internet Explorer.
Posted by: dotnetninja | October 9, 2008

Hosting Silverlight in the SharePoint WebPart

There are several way to host silverlight application in the SharePoint. You could use Silverlight BluePrint for SharePoint from codeplex http://www.codeplex.com/SL4SP and one of the best posts until now is this from Kirk Allen Evans’s Blog.

Enjoy!!

« Newer Posts - Older Posts »

Categories