I need to put a link to the "Connect to Outlook" script on a SharePoint 2010 page. I have built the stssync:// URL that triggers the Outlook sync: stssync://sts/?ver=1.1&type=discussions&cmd=add-folder&base-url=[MyServer]&list-url=[MyList]&guid=[MyGUID]&site-name=[MySiteName]&list-name=[MyListName]

Now the link works fine when pasted in IE address bar. However, I can't add it to a Sharepoint page - if I try to use the "insert hyperlink" button Sharepoint will complain about the stssynch:// protocol "URL must be in the form of http://" (or something to that effect).

I have tried to add a regular link that change the URL by editing the page's HTML. However, Sharepoint removes the link on saving the page.

How can I add the stssync:// link to a page? Is there any simple way to somehow "wrap" it in http or something?

  • btw, you know how to do the same with a new content type item dialog form (in a docLib). i'm using this javascript... javascript:EditItem2(event,"/_layouts/listform.aspx?ListId={YOUR_LIST_ID}&RootFolder=YOUR_ROOT_FOLDER&ContentTypeId=ITEM_CONTENTTYPE_ID"); ...but with no success!
    – fallout
    Jun 9 '11 at 10:33
  • I tried to insert that link via SharePoint designer, but the link will be removed when saving the site ("Content in embedded form field may be changed by server to remove unsafe content"). I also tried to call a simple js file that will open the link, but I get the same error.
    – AlexPoint
    Jun 9 '11 at 13:52
  • @AlexPoint Thanks for your edit! It's true that this only applies to 2010 now, but we don't know for the next version. So I kept the version in the text but removed the version specific tag. Please see How do I user tags on our meta for more info.
    – Alex Angas
    Jun 16 '11 at 7:48

You can add the following code to a Content Editor webpart or directly onto the page. After adding the CEWP, in the ribbon use Editing Tools > Format Text > Edit HTML source.

<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script language="javascript" type="text/javascript">
  function replaceURL() {

<a id="outlookLink" href="#">Link to Outlook</a>

Here's what it is doing:

  1. Includes a reference to the jQuery library, which you can either do as in this example or you can download it to your site and include a reference to that location on your site instead.

  2. replaceURL() uses the jQuery .attr() method to change the href attribute of the anchor tag with the url that you want.

  3. _spBodyOnLoadFunctionNames.push() will call your function as soon as the page loads.

  4. Your link should have an id which you refer to in your function. The href can be anything, since it gets modified by your function as soon as the page loads.

NOTE: You could use straight javascript instead of jQuery, but the syntax is more complicated.


I don't believe you will have a way to change this behavior without modifying core files.

Have you looked into custom field types? This allows you to build in custom validation and allow alternate protocols.


You could get creative and try to do some redirects, possibly some type of type of custom shorting / translation service that will take an HTTP link and change it to STSSYN. It would essentially be external to SharePoint.


In 2010 there are 2 options. The easiest solution is to wrap the link in a Content Editor web part. To do so:

  1. Browse to the SharePoint page in the browser
  2. Click on Edit on the Page ribbon
  3. From the Insert ribbon select More Web Parts
  4. Select Content Editor and click Add
  5. Edit the new Content Editor web part
  6. Under the Content Editor label, click on "Click here to add content"
  7. Ensure the cursor is within the Content Editor web part and switch to the Format Text ribbon
  8. Under Markup, click the HTML button and Edit HTML source
  9. Add the link to the HTML and click OK. The STSSYNC link should be the href property.
  10. Click OK again and save the page. The link is now active and users can click on it to attach to the list.

I hope this helps, please let me know if there are any missing steps. Cheers!

  • Thank you for your reply and sorry about the confusion: We need a solution for SharePoint 2010. I will update the question. If you have a solution that works in SP2010, I'd be happy to award you the bounty!
    – AlexPoint
    Jun 16 '11 at 7:38
  • @AlexPoint Updated with steps. Let me know how it goes. Jun 16 '11 at 14:42
  • Thank you for your answer. These steps however do not work as desired. After I paste in the STSSYNC link, a massage is displayed that says "The HTML source you have entered might have been modified". When I click "Save & Close" the link is converted into plain text.
    – AlexPoint
    Jun 20 '11 at 8:00
  • Did you type in your link like this: <a href="stssync://sts/?ver=1.1&type=discussions&cmd=add-folder&base-url=[MyServer]&list-url=[MyList]&guid=[MyGUID]&site-name=[MySiteName]&list-name=[MyListName]">Link to Outlook</a> That should work, but if not try the answer I'm posting to use jQuery to change the link when the page loads.
    – Laurie
    Jun 20 '11 at 15:29
  • @Laurie: Yes, I tried that but the link has been converted into plain text.
    – AlexPoint
    Jun 21 '11 at 7:31

This goes along with Carsten's Content Editor answer.

For SP2010 if you want your HTML to remain untouched by SP put it it into a text file that resides somewhere on your site (like in the Site Assets folder). Then in the webpart options of the Content Editor just reference your file (/siteassets/myhtml.txt). SP won't rewrite the code, it will just use whatever is in the file.


So you may not be looking for this, but I did for hours and didn't find it so I had to figure it out. To embed a link to connect outlook to a "Group Calendar" you can use JQuery SPServices (located here: http://spservices.codeplex.com/downloads/get/786994 )

Place the below in a CEWP:

<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://.../Scripts/js/jquery.SPServices-2014.01.min.js"></script>
<script language="javascript" type="text/javascript">

var Username = $().SPServices.SPGetCurrentUser({
    fieldName: "Title",
    debug: false

var UserID = $().SPServices.SPGetCurrentUser({
    fieldName: "ID",
    debug: false

document.write('<a href="stssync://sts/?ver=1.1&type=calendar&cmd=add-folder&base-url=[Site URL]&list-url=%2FLists%2F[List Name]%2F&guid=[List GUID]&user-id=' + UserID 
+'&site-name=[Site Name]&list-name=' + Username +'">Click Here</a> to sync up with our Group Calendar now.');

If you directly copy the codes, it will have the following error:

enter image description here

You need to modify the code, if it is calendar, you need to copy the template below (It is working, I published in my SharePoint website) and change to your information.

<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script language="javascript" type="text/javascript">
  function replaceURL() {
  $('#outlookLink').attr('href','stssync://sts/?ver=1.1&type=calendar&cmd=add-folder&base-url={Type your server name and take off the {} }&list-url={Type your list name and take off {}}&guid={Type your GUID and take off {}}&site-name={Site Name}&list-name={list name}');

<a id="outlookLink" href="#">Link to Outlook</a>

In addition, you need to rewrite all your link in HTML format, here is a coder and decoder may help. HTML Decoder and Coder http://meyerweb.com/eric/tools/dencoder/

Let me know if there is any questions, my website www.zzhang.info

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.