Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>With Paul-Jan's pointer, I've figured this out. Since I hate it when I only find indirect hints while googling, here's exactly the code you need:</p> <pre><code> private string getSharepointURL(Microsoft.Office.Interop.Outlook.Folder SharepointFolder) { if (!SharepointFolder.IsSharePointFolder) throw new Exception("Cannot get the SharePoint URL of " + SharepointFolder.FullFolderPath + ", because it is not a SharePoint folder."); return (string)((object[])SharepointFolder.GetTable("", 1).FindRow("[From] = SharePoint").GetValues())[1]; } </code></pre> <p>That may be the ugliest return statement I've ever written. Here's what it does:</p> <ol> <li>Calls Outlook.Folder.GetTable("",1). The first argument is a filter, which means "anything", and the second argument is equivalent to <a href="http://msdn.microsoft.com/en-us/library/bb176809.aspx" rel="nofollow noreferrer">olHiddenItems</a>. (I couldn't find the actual enumeration)</li> <li>Gets the next row of that table whose sender (the [From] field) is "SharePoint". The information we want is always held in this hidden message.</li> <li>Gets the values of that hidden message. This comes back as an object, but is secretly an object[].</li> <li>Casts the values to an object[].</li> <li>Gets the second item of the values, which is the url.</li> <li>Casts the url to a string.</li> </ol> <p>Fortunately, you can do all these steps yourself in OutlookSpy. That was a real help in figuring out how to get at this precious nugget of information.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload