Saturday, January 8, 2011

How to enable the “save and send” option in Office 2010 to SharePoint 2010 on your virtual machine

 

One of the nice cool features in Word (or other Office 2010 programs) is the option “Save and send” –> Save to SharePoint. You can either ‘browse for a location’ of just click on one of the recent locations you’ve opened earlier.

image

This way, you can save directly to a SharePoint Server.

It also works when you are in a SharePoint 2010 site and when you create a New Document from the browser, your Word 2010 will open and after editing, you can choose “Save and send” –> Save to SharePoint and ‘Browse for a location”. SharePoint will automatically find the url of the SharePoint site you created the new document from.

image

This works by default on my windows 7 host machine. However… whenever I’m working on my Windows 2008R2 SharePoint 2010 server, this doesn’t seem to work by default. I do excactly the same. I’m on a default team site. I create a New Document from within the shared documents library. The blank Word file opens automatically in Word 2010. After finishing my document, I try to save it directly to the Shared Document library on my SharePoint 2010 team site.

image

When I choose a file underneath ‘recent locations’ or ‘Browse for a location’ different things are starting to happen.When I click on the option underneath ‘Recent Locations’, I get the following error message:

image

After clicking OK, I get prompted with this next screen:

image

In contrary with what happened in my Windows 7 host environment, I cannot save the Word file back to the Shared documents library in the SharePoint team site.

When I try ‘Browse for a location’, the same thing happens.

I didn’t pay a lot of attention on this matter. In september 2010 the SharePoint Connections event was held in the Hague, Netherlands. A lot of international presenters were doing workshops in this conference. During one of the sessions, Asif Rehmani was having the same issue and he asked publically if anybody knew a solution for this. Ok. That got me triggered. So it wasn’t just my vmware instance.. Glimlach

Just recently I found the solution… I admit, it was by accident.

Does this picture look familiar in your Windows Server 2008 R2 image?

image

It lacks one important option… the ‘Disk cleanup’ option is not available. After doing some searching on the internet, I found out that this option is by default not activated withing Windows Server 2008 R2. By installing a feature (not a SharePoint Feature), this option will become available again.

The Feature I’m talking about is the ‘Desktop Experience’. The Desktop Experience feature enables you to install a variety of Windows 7 features on your server running Windows Server 2008 and Windows Server 2008 R2. For a full list of all the feature, please read this technet article.

Go to All Programs –> Administrative Tools –> Server Manager. Choose Features –> Add Features

image

Next, check the ‘Desktop Experience’ feature. On the popup, choose ‘Add Required Features.

image

Choose NEXT and INSTALL. This is a good time to get some coffee and have a little break, because it will take some seconds for Windows to install this feature. After this, you are prompted with the question if you want to restart your server to finish the installation. Of course you want to do this, so restart your server. This will take some more time, so now you can do the dishes, make your bed, send your kids to bed, watch a good movie, go to bed. Sleep. Wake up, shower, get dressed, prepare breakfast and brush your teeth. After this, you server should have restarted again and will finish the installation.

Now, when trying again creating a new document from the ‘shared documents’ library and saving it back into SharePoint, I don’t get the error message, but instead the word file is saved to the ‘shared documents’ library.

image

Ain’t that a happy ending.

Wednesday, August 25, 2010

SP2010 page reacting strange on javascript code through content editor webpart

I’m working on a SP2010 team site for a client. One of the requirements is a graphical view of the traffic news near the clients location. Of course you can do this through SPD2010 and calling a webservice (soap or REST). Another simpel way is adding some javascript code in a hidden content editor webpart. In the Netherlands the ANWB has a nice feature where you can call some javascript code within your HTML page. After this a graphical image is rendered with the most recent traffic news. The image looks like this:

image

What I did for my customer was adding a hidden content editor webpart on the page (mine was based on the wike template, but this issue happens also on the default default.aspx with webpart zones). Via HTML I selected the Edit HTML source within the content editor webpart.

image

After this I added the following bit of code…

<script type="text/javascript">
<!--     
      var anwb_tool="verkeersinformatie";
//-->
</script>
<script type="text/javascript" src="http://www.anwb.nl/verkeer/verkeerstool.js">
</script>

After a couple of seconds the image was rendered. I was a happy man and was already dreaming of drinking my beer when I got home, when I pressed ‘Save and Close’. Suddenly I had 2 rendered images… I returned back to the page, edited the content webpart again and pressed ‘Save and close’ again. Suddenly I had three (yes 3) rendered images… Apparently, every time you hit the ‘Save button’ SP2010 somehow renders the code again and adds another image in the webpart…..

image

Please try it out yourself. For the javascript code, please visit http://www.anwb.nl/binaries/doc/verkeer/verkeerstooltjes-code/code-zonder-kaart.txt and copy past the code in a content editor webpart in your SP2010 site.

Within the SP2010 Content Editor Webpart, you now have the option to link to a seperate file to include in your webpart. I put a .txt file in the assets library and typed in the url. This worked and the image is only rendered once.

image

Question is… Is this a bug (or feature) in SP2010 or just crappy coding from the anwb developer???

Wednesday, June 2, 2010

How to create a security trimmed top link in a WSS 3.0 site

Introduction

The other day I had this issue with an out of the box WSS 3.0 site. I had created some subsites. While creating the subsite, one of the options is to choose ‘Display this site on the top link bar of the parent site?’ You can either choose Yes or No.

image

Choosing Yes will of course show the link to this subsite, choosing No will not show the link. Incidentally I choose No in one of my subsites, thus the subsite is not showing in the top link bar of the parent WSS site. It does show in the quick launch bar.

image

Within WSS 3.0 you have the option through Site Actions, Site Settings, in the Look and Feel column to go to the Top link bar and create your own custom ‘tabs’. I created the subsite3 tab and it did show now on the top link bar. Issue closed, me:1 SharePoint: 0…… Not!!!!!

Security trimmed navigation

Here is where security comes into play. When you create a subsite, automatically SharePoint makes it a security trimmed ‘tab’ or link. Meaning, if you have permissions on this subsite, you’ll see the tab. If not, the tab will not show. Nothing new under the sun is it? Just plain good old SharePoint. However, the tab ‘subsite3’ I just created is NOT, I repeat, NOT security trimmed. BTW, if you had chosen Yes and let the link be displayed on the top link bar and then deleted the link and re-created it, it also would not be security trimmed.

I’ll show you how you can see this in the Top link bar and in a real time scenario.

Through Site Actions, Site Settings, in the Look and Feel column go to the Top link bar. Click on the edit button before ‘subsite1’. Notice that the url is greyed out?

image

Now go back 1 step and click on the edit button before ‘subsite3’. Notice that the url is NOT greyed out?

image

Real time scenario

In subsite 1 and 3 I broke the inheritance with the top level Demo site collection and created unique permissions. My demo user ‘Marc Manager’ does NOT have permissions to these subsites. Marc Manager has only got permissions on the top level Demo site collection and Subsite 2.

image

Now, when I log on with the credentials of Marc Manager, you will see that the ‘Subsite3’ tab is NOT security trimmed. The ‘subsite1’ tab is not show, the subsite3 tab does show because it’s just a link. Notice that in the quick launch the ‘subsite3’ link has dissapeared. This is because when I created the subsite 3 website, I choose the option ‘Display this site on the quick launch of the parent site, YES’, thus making it a security trimmed link.

image

So obviously, Marc Manager – the guy he is -  sees the subsite 3 link. When he clicks on it, he will get the logical error, and blaming the whole world and IT Pro’s for this not so friendly error message…..

image

the big questions is.. How can we solve this?

The solution

Okay, ready to dive into some SharePoint Designer? Open up Sharepoint Designer and open the Demo top level site collection website. Always wondered what this Navigation link was?

image

You can also go in the Menu Bar to Site, and choose Navigation from the pull down menu.

You will get this nice Visio kinda’ tree view of the Demo website. This is called the Navigation Map.

image

Within SharePoint Designer, in the Navigation Map you can also build you own top link bar links and quick launch links.  Now right-click on the most right Tab ‘The SharePoint Tob Navigation Bar’ and choose ‘View subtree only’. You will see something like this:image

The Sharepoint Top Navigation Bar has 4 nodes under it. One is Home, which point to the Home page of the Top level site and the others are Subsite1, subsite2 and subsite3.

Now right-click the Sharepoint Top Navigation Bar node and click New -> Page. It will add a node under the Sharepoint Top Navigation Bar. Double click it (this is very important that you do this), it will create a untitled htm page (which you can close immediately) and then back on the untitled 1, right-click it. Choose Properties. You will see something like this:

image

It will allow you to Edit the Hyperlink. If you scroll down, you will see that the Subsite3 site is listed and you could dubbel click it and then select the ‘default.aspx’  and click OK. After this, click once on the untitled 1.html and it will change into the newly created hyperlink. The new added node will point to the Subsite3 now. BTW, the title now shows Subsite3/default.aspx. You can change the title into ‘Subsite 3 security trimmed’ by clicking once on this title. The end results shows something like this:

image

Save the site and then close Sharepoint Designer. Go back to the WSS Demo site, log into this site with administrator credentials and you will find the Subsite3 security trimmed tab is listed in the Top Link Bar.

image

Just checking. Again, go to Site Actions, Site Settings, in the Look and Feel column go to the Top link bar.  Click on the edit button before ‘subsite3 security trimmed’. Notice that the url is greyed out?

image

Almost there. Now go to the edit button before ‘subsite3’ and choose Delete.

Finally, go back to the WSS top level site collection Demo and again login with Marc Managers’ credentials. Marc will now only see the sites he’s got permissions on through the security trimmed top link bar.

image

Marc Manager is now a happy SharePoint demo user again….

Tuesday, March 23, 2010

Changing the default operator on the SharePoint Advanced Search

In one of my SharePoint projects, the customer asked the following question: “Can you add another operator in the property picker on Advanced Search aspx and can you change that operator into the default operator”?

Out of the Box advanced search

The out of the box Advanced Search page looks like this:

image

In the last field “Add property restrictions” you have 2 options in you default operator menu: the “Equals” and “does not equals” option. Before the Infra Structure update, you also had the options “contains” and “does not contains”. But Microsoft decided to remove this because these options can heavily decrease performance because expensive Transact-SQL queries are generated in this search scenario. For more information about this, read KB950437.

In my scenario, the customer wanted these options back and set the “contains” as the default operator.

Adding the ‘Contains’ operator

To do this simply go to the  Properties section of the Advanced Search Box configuration, click on the dialog box as seen below and then in the Properties xml on the top of the XML, change the default Value=”False”  into “True”:

     <Option Name=”AllowOpContains” Value=”True”/>

 image

After hitting the Apply button and saving this page, you get the two extra options:

image

Setting the ‘Contains’ operator as the default value

Now for the second requirement, I searched for a solution in Jquery which could be put in a hidden Content by Editor webpart. With the help of Marc D Anderson (follow him on Twitter @sympmarc) and his Jquery library for SharePoint Web Services website, I found the right code for this.

First of all, download the latest version of the jquery-1.4.2.min.js and put this in the document library that also contains the advanced.aspx. But be welcome to put in in any library of your choice. In the code underneath I make a reference to this jquery-1.4.2.min.js. BTW, always use the minified version in a production environment.

On the advanced.aspx page I have put a hidden Content editor webpart. In the source editor I put the following code, which results in setting the 'contains' operator as the default value:

<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("select[Title='Inclusion Operator'] option[Value='Contains']").attr("selected", "selected");});
</script>

This does the trick!

image

That’s a wrap

Without using heavy coding a power user can do many things on the SharePoint platform. You can extend your out of the box SharePoint with the help of using Jquery. On the internet you can find many resources with ‘ready to go’ Jquery scripts for your SharePoint platform and extend the SharePoint user experience. Be careful to test your code always in a test environment before putting it live on a production environment!

Monday, March 8, 2010

SharePoint 2010 & Office 2010 Launch may 12th

Microsoft has spread the news. The new SharePoint 2010 RTM and Office 2010 RTM will be released on may 12th. No more working on unsupported Beta 2 or RC's. Finally things will go through!

for more information, check the Microsoft SharePoint Team blog.

Tuesday, November 24, 2009

Ontwaak met e-office en SharePoint 2010 (DUTCH ONLY)

Het einde van het jaar staat vaak in het teken van goede voornemens voor het nieuwe jaar. Wat zijn uw goede voornemens op zakelijk gebied?

Wilt u uw mensen en hun kennis nu echt gaan verbinden? Bent u op zoek naar manieren om effectief klantcontact te bereiken? Of wilt u de communicatie en bereikbaarheid van uw professionals optimaliseren?

e-office neemt u graag mee op weg naar 2010. In een aantal interactieve sessies ontwaakt u in 2010 samen met e-office en zullen wij u inspireren hoe u uw voornemens waar kunt maken met de inzet van Microsoft SharePoint 2010.

In 2010 organiseert e-office de volgende ontbijtsessies:


12 januari SharePoint 2010: verbinden van mensen en kennis
2 februari SharePoint 2010: effectief klantcontact
2 maart SharePoint 2010: optimale communicatie en bereikbaarheid

Interesse?
Voor meer informatie, het programma of deelname aan de klantsessies bezoekt u onze website

Tuesday, November 3, 2009

Short Overview of SharePoint Features in Visual Studio 2010

Now that the SharePoint conference is over and everybody is all exited, I as a functional SharePoint consultant, am looking with interest to the new Visual Studio 2010 editon. I rarely use it right now in my day to day work. Looking at the new features, I know one thing.... I'm going to use VS2010! It looks very nice.

The Microsoft SharePoint team has a nice blogpost with al the features in it. Check it out! Very cool I found the integration between SharePoint designer 2010 and VS2010. I can build custom site templates and import them to VS2010 and make a feature in a solution from it.
The features I see myself working with are:
  • Feature and package Designer
  • SharePoint explorer (looks a bit like SharePoint manager 2007)

Can't wait to start!