Microsoft Office documents, im my case: PowerPoint presentations, can have restricted permissions. How can I find out, programmatically, which permissions my code has on a g
Try one of the functions GetUserName(), GetUserNameW() or GetUserNameA() and declare it thusly:
Private Declare Function GetUserName Lib "advapi32.dll" Alias _
"GetUserName" (ByVal lpBuffer As String, nSize As Long) As Long
Also see MSDN about GetUserName.
You need to dim a string with length 255 and pass 254 as parameter nSize. This string is passed ByVal back to the caller. Perhaps you need to left() the string before you can use it to compare it with uperm.UserId.