views:

276

answers:

3

I need to create a shortcut file that links to a sharepoint document library and then send that in an email (don't worry about outlook blocking lnk files). I have had a look at how to how to create a standard shortcut file in C# but this fails when you give it a server address (\servername\site\documentlibrary)

Does anyone have an idea on how to do this.

Also would be super to know how i can convert the link into and SPFile object so that i can also attached it to a list item once i have created it.

To try and add some more context. I cannot just send the user an html link in an email as the end functionality is that the user will be able to dragfile onto the shortcut and have them imediatly uploaded to the document library.

+1  A: 

Can't you just send the URL of the document? Or does it need to be a UNC link?

If you are looking to send a link in email, just right click the link, copy the URL and paste it into the email.

If you are looking for a UNC based approach, a quick way to do it is make sure the WebClient service is running (this is important!). You can then open the file in Windows Explorer view and prepend the folder name you will see in the address bar to the name of any file in the folder and send to users via email.

Not sure I understood your question exactly, so if I am stating the obvious, apologies!

John

John Ptacek
Thanks for your answer. It needs to be a UNC link as we are trying to replicate the "ease" of use they have with their network drives. So we are trying to make the end user use the web as little as possiable. A bit strange i know, but client knows best.
Paul
+1  A: 

Interesting concept, but you may want to consider using a more 'web friendly' way of dealing with shortcuts, for example Short URLs.

I have worked on a TinyURL implementation for SharePoint which can be accessed from a Web Service, SharePoint User Interface as well as a SharePoint Designer workflow.

I am obviously biased as I worked on this, but you may want to consider it.

Muhimbi
A: 

For more suggestions on using URLs instead of files, see a similar question here.

Rich Bennema
thanks but needs to be a shortcut file then can have on their desktop or computer somewhere.
Paul