GetNamespace OpenSharedFolder SharePoint Calendar URL Method

G

Guest

I am trying to access a sharepoint Calendar event list but can not seem to
access the SharePoint Lists.pst.

Here is what I got on C#.
// Create an Outlook application.
Outlook._Application olApp = new
Outlook.ApplicationClass();

// Get the Mapi NameSpace and the Logon.
Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
olNs.Logon("YourValidProfile", Missing.Value, false,
true);
Outlook.MAPIFolder oFolder = null;

string cro =
"http://infoadm.com/sites/infoquality/Lists/MDB Data Activity
Calendar/calendar.aspx";
oFolder = olNs.OpenSharedFolder(cro,null,null,null);


// oFolder.Display
Console.WriteLine("WTF: " + oFolder.Name);


When I run the program I get this error,
System.Runtime.InteropServices.COMException (0x80020009): Invalid shared
folder.

at
Microsoft.Office.Interop.Outlook.NameSpaceClass.OpenSharedFolder(String Path,
Object Name, Object DownloadAttachments, Object UseTTL)
at OutlookExamples.OutlookClass1.Main(String[] args) Exception caught.

I can access and list my default Calendar but am stuck on how to access a
sharepoint calendar. Does anyone know how to use the "openShareFolder" I
have had no luck finding any refernence to this new method in Outlook 2007.

Thanks
-cro
 
S

Sue Mosher [MVP-Outlook]

As the Help topic for OpenSharedFolder explains, Sharepoint URLs need to use the stssync:// prefix not http://
 
K

Ken Slovak - [MVP - Outlook]

Hi,

If you look at the Object Browser Help for OpenSharedFolder you should see a
note that for SharePoint folders you use an URL in this form:

"stssync://mysite/myfolder"

So it looks like your URL needs some adjustment.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top