d_kudalkar

Hi all,

I am facing problem while accessing document from SharePoint server located on port other than 80.

I want to access SharePoint document in my C# application.

I have two options; either to use Dot Net dialog boxes or MS Word dialog boxes.

1) Using MS Word dialog box in C#, I can open the document successfully. I am accessing MS Word dialog box using Word.Application in C# (com - Word 11.0 library).

But the problem exists with saving the document. The newly created document to save is not necessarily Word document, it can be pdf or txt (or with some other extension). So I need to pass filters to Save File Dialog box. And For MS Word Save File dialog box, we can not pass filters (It gives runtime error).

If we can pass filters to MS Word Save File dialog box, then also my problem can be solved.

2) I have preferred to use Standard dot net dialog boxes (Which are similar as dialog boxes used in notepad) due to limitation of MS Word dialog box specified above.

Standard dot net dialog boxes works finely with filters but has some problems with accessing SharePoint documents on port other than 80.

SharePoint server is located at path:

http://sharepoint-serv:26791/sites/mysite

I have uploaded text document (SharePoint Doc.txt) on path

http://sharepoint-serv:26791/sites/mysite/mydocs

When I opened this txt document, the path returned was from "Temporary Internet Files" folder.

If you open any document on SharePoint server located on port 80, it is directly opened from SharePoint server without downloading it on local machine.

I has observed same problem in notepad also.

I tried to access the document as:

1) I opened notepad

2) Clicked on File>>Open menu

3) Typed path http://sharepoint-serv:26791/sites/mysite in Filename section, and selected file SharePoint Doc.txt.

4) But the file opened as SharePoint Doc[1].txt, means notepad downloaded to folder - "Temporary internet files" which is not

expected(if you open any word document on SharePoint server, it is directly opened from SharePoint server without downloading

it on local machine).

5) When I tried to save the document, the Error message displayed as

Cannot create the C:\Documents and Settings..... \Temporary Internet Files\...\Sharepoint Doc[1].txt

Make sure that path and filename are correct.

I have also tried to open the document as \\sharepoint-serv:26791\sites\mysite\SharePoint%20Doc.txt, still its not working.

If the SharePoint server is located on default port (port 80), this problem doesn't exist.

When I tried to access document on other SharePoint server http://sharepoint-serv/Shared%20Documents, It's working perfectly.

About environment, I am using operating system Windows XP with service pack 2 installed. I am using Visual Studio 2005 and Microsoft Office 2003.

SharePoint server in located in intranet having operating system Windows Server 2003

It seems notepad dialog box/Dot net dialog box can not open documents for port other than 80.

Are there any settings required to solve this problem

(I have already posted same problem in "General Questions" section but haven't found any answer, so I am posting this problem in this Development section)



Re: SharePoint - Development and Programming Problem while accessing document from SharePoint server located on port other than 80

smc750

I cannot explain why you would get different behaviors based on a port number. However, I do know that your best bet in creating desktop client applications that open and save sharepoint documents is to use the Remote Procedure Call protocol. You can create c# code that uses a webrequest object that makes calls such as "get document" and "put document". You can use the dialog box for users to choose the document url and then use the url to make the rpc call. Microsoft Word is also using RPC. RPC will handle any type of document and does not rely on the temporary internet folder. For more information using RPC you view it in the wss sdk at

http://msdn2.microsoft.com/en-us/library/ms442469.aspx






Re: SharePoint - Development and Programming Problem while accessing document from SharePoint server located on port other than 80

d_kudalkar

Thanks for your reply.

If I have correct url, then I can access the SharePoint document. If I am providing URL from text box like

http://secondshptsrv:47341/sites/mysite/documents/01.doc

Then through web service located on Sharepoint server, I can easily access the document. But it's not good idea to provide text box to select the document, So we need to provide dialog box. And my problem is dot net dialog box is not returning correct path. Instead of SharePoint server document path, it's returning path from "Temporary Internet Files" folder.