Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have opened a ticket with Microsoft on this (SRQ091221600157). After a lengthy discussion with Microsoft Support, the ticket is still pending but I think it is already safe to say that there is no explicit way to obtain the information I need.</p> <p>Microsoft explicitly states that there is no API in PowerPoint to obtain either the identity that was used to open a presentation, or the currently active permissions. A feature request to add that API has been filed.</p> <p>If you are in a closed environment with your own Rights Management Server, the following approaches would probably work (quoting Microsoft Support, I did not test this myself):</p> <p>1) Using the COM object ADSystemInfo object.</p> <pre><code>Dim objADSystemInfo As Object Dim objUser As Object objADSystemInfo = CreateObject("ADSystemInfo") objUser = GetObject("LDAP://" + objADSystemInfo.UserName) objUser.Get("mail") 'This will return the AD email id 'We can use this to include in the permission related code that you had sent If (uperm.UserId = objUser.Get("mail")) Then 'You can get the permission uperm.Permission for this userid (current logged in) MsgBox(uperm.UserId &amp; "logged in user") Else MsgBox(uperm.UserId &amp; "other user") End If </code></pre> <p>2) Using the .NET approach</p> <pre><code>Dim oDS = New System.DirectoryServices.DirectorySearcher Dim strUserName As String = Environment.UserName Dim strFilter As String = "(&amp;(objectCategory=User)(samAccountName=" &amp; strUserName &amp; "))" oDS.Filter = strFilter Dim oSr As System.DirectoryServices.SearchResult = oDS.FindOne() Dim oUser As System.DirectoryServices.DirectoryEntry oUser = oSr.GetDirectoryEntry() MessageBox.Show(oUser.InvokeGet("mail")) </code></pre> <blockquote> <p>Here is the article that explains about these approaches –<br> <a href="http://www.microsoft.com/technet/scriptcenter/resources/pstips/dec07/pstip1207.mspx" rel="nofollow noreferrer">http://www.microsoft.com/technet/scriptcenter/resources/pstips/dec07/pstip1207.mspx</a></p> </blockquote> <p>However, these approaches do not work for identities that use online IRM services (Microsoft Passport). Also, even with your own Rights Management Server, it may be possible to change your identity in PowerPoint at runtime, in which case the above approaches probably would not yield the desired results (I did not investigate this any further).</p> <p>I the end, I had to come up with a workaround that tests the permissions I need by trying to run some representative API call and then checking if the call failed.</p> <p>Thank you for your contributions,<br> Volker</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