Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

If you open the DispForm.aspx for an item in a Calendar List, you see a link and display text to the Meeting Workspace (if one exists) for that event.

How can I access the link to the Meeting Workspace from the Object Model? There appears to be a boolean field called "Workspace" which says if one exists or not, but I can't seem to find a way to see which Workspace it links to.

Any ideas?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

This seems to work for me

using (SPSite site = new SPSite("http://siteurl"))
        {
            using (SPWeb web = site.OpenWeb())
            {
                SPList calendar = web.Lists["Calendar"];

                foreach (SPListItem item in calendar.Items)
                {
                    bool hasWorkspace = Convert.ToBoolean(item["WorkspaceLink"]);
                    if (hasWorkspace)
                    {
                        string workspace = item["Workspace"].ToString();
                    }
                }
            }
        }
share|improve this answer
    
Apologies, took too long to reply! That does work now, thanks. Not sure where I was going wrong, think I was (somehow) confusing Workspace and WorkspaceLink fields. Thanks again. –  James Love Apr 23 '10 at 11:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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