none
Possible to get an unique ID of the currently logged in Office account? RRS feed

  • Question

  • Is it possible to get an uniqe ID of the currently logged in office account in PowerPoint/ Word?

    Monday, January 2, 2017 1:18 PM

All replies

  • Hi P43R0,

    you can use Application.UserName to get currently logged in user in any MS Office Application.

    Example to get the user:

    Sub demo()
    MsgBox "Current user is " & Application.UserName
    End Sub

    Example to set the user:

    Application.UserName = "Demo User"

    Reference:

    Application.UserName Property (Word)

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 2, 2017 11:53 PM
    Moderator
  • Hi,

    Thank you for your answer. I'm sorry I was a bit unclear; I probably posted in the wrong forum or should have specified that I'm talking about the newest Office add-in technology based on javascript.

    And when I'm talking about the currently logged in user I mean the user that is signed into Office 365:

    Tuesday, January 3, 2017 7:58 AM
  • Word JS API doesn't provide anything for that.

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Tuesday, January 3, 2017 6:57 PM
  • Hi P43R0,

    As other community member already suggested you that currently it is not possible with JavaScript Api.

    below is JavaScript Word Object model. you can refer it. you will find that there is nothing to achieve your requirement.

    Word JavaScript API reference

    currently JavaScript Api provide the limited functionality.

    if you want to include this feature in JavaScript Api in future then please submit your feedback to user voice.

    Word User Voice

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, January 4, 2017 5:48 AM
    Moderator