none
How to Set Document's Author name from AddIn regardless of local or cloud account?? RRS feed

  • Question

  • Hi All,

    I have a Word 2010 VSTO AddIn that relies on changing the AuthorName to flag  revisions made by my AddIn (with Track Changes On).  However, in Word 2013, the Author behavior is obviously different. 

    I've found that you can change the Application.UserName field, but this does NOT always affect the revision author.  If the user is NOT signed into the Cloud, the Revision.Author will have the value of the Applicatino.UserName.  If the user is signed into the Cloud, then the Revision.Author has a value that I'm guessing is set from a different location (probably the Cloud Account Name).  Does anyone know how to have Revision.Author always use Application.UserName (preferred since this is how O2010 worked) or how to override the UserName supplied from the Cloud account??

    Thanks, WordRake

    Monday, March 4, 2013 11:35 PM

Answers

  • Login is new feature in Office 2013. As you realized, default behavior is that if you logged in, the logged in account will be set as revision author, otherwise, revison author is application user name.

    Now that you still want old behavior, will you consider sign out when you editing the document? The revision.Author property is readonly, once it's set by Word automatically, people cannot change it programatically.

    I'll forward your requirement to product team, so they may consider add a switch for this behavior in next product release.

    thanks.


    Forrest Guo | MSDN Community Support | Feedback to manager

    • Marked as answer by WordRake Friday, March 8, 2013 6:18 PM
    Friday, March 8, 2013 9:49 AM
    Moderator

All replies

  • Hi WordRake,

    Thank you for posting in the MSDN Forum.

    Does anyone know how to have Revision.Author always use Application.UserName (preferred since this is how O2010 worked)

    I think this is not a good practice and goes against what Revision.Author was designed for. From Revision.Author property, we can see who made each revision to the document and I believe that's why this property was designed as a read only property.

    If you want to show a specific account in the Revision.Author, you can log out the current account and login with that account you want to use.

    Hope it helps.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 5, 2013 8:10 AM
    Moderator
  • Quist,

    Actually, my AddIn is actually making the suggested changes, and thus I want the Revision.Author to reflect this fact by setting the Application.UserName to my AddIn name.  I return the Application.UserName to the user's name when the AddIn has completed its suggested changes.

    This works perfectly fine in O2010.  I save the current value of "Application.UserName", set it to my AddIn Name "WordRake", make my suggested changes to the document which generates Revisions with Revision.Author having a value of "WordRake", and when I'm done making suggested changes, I return the "Application.UserName" to its original value.  Thus, any manual changes generate Revisions with Revision.Author having my manually set value for UserName, while my AddIn changes generate Revision with Revision.Author set to "WordRake".

    Users are allowed to manually change "Application.UserName" via the File/Options/General/userName field and my AddIn is doing the same thing.

    However, in O2013, when the user is "Signed in" to the Cloud, "Application.UserName" is no longer the value used when Track Changes is on and I either manually or thru my AddIn make a suggested change.  This seems broken to me, or at the very least, a change in the functionality of Word.  I can no longer manually change my username to what I want reflected in the revisions that I make to a document while TrackChanges is turned on.

    How can I manually change my username to reflect what I want?

    Thanks.

    Tuesday, March 5, 2013 6:20 PM
  • Hi WordRake,

    As Quist mentioned in his last reply,

    If you want to show a specific account in the Revision.Author, you can log out the current account and login with that account you want to use.

    I think you'll need to log out and sign in with another user account.


    with regards, Yuri


    Wednesday, March 6, 2013 2:11 AM
  • OK,

    Let me make sure I understand what you are saying.  For my AddIn to change the Author Name, my AddIn has to log out of the user's account, log in to some fictitious account named WordRake while staying within Word, make my Track Changes to the document, log out of the fictitious account and log back into the users account (which of course the AddIn does not know the user's password).  Are you serious??  So i would interpret this answer as "I can't do want I want" kind of answer.

    Understand, I'm talking about an AddIn being able to change the Author's name.  This works just fine if the user is logged into a local account.  It only does NOT work if the user is logged into a cloud account.  Please make the behaviour consistent, and of course, being consistent with O2010 would be really really nice.  For instance, why does the Cloud Account not set the Application.UserName field based upon it's name convention (like local accounts do) and let Revision generation still utilize the Application.UserName field instead of some secret field provided by the Cloud Account other than the Application.UserName field.  The Application.UserName field is programmatically setable by an AddIn.

    I do appreciate your responses.  I obviously am not excited about the direction the answers are taking me, as this will completely undermine our product and require significant change (probably beginning with our inability to support O2013).

    Thanks, WordRake


    • Edited by WordRake Wednesday, March 6, 2013 5:27 PM
    Wednesday, March 6, 2013 5:19 PM
  • Hi WordRake,

    I'll consult your issue with my colleague. You'll be informed if there's any update.

    Thank you for your patience and understanding.

    Best regards,


    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 7, 2013 8:34 AM
    Moderator
  • Login is new feature in Office 2013. As you realized, default behavior is that if you logged in, the logged in account will be set as revision author, otherwise, revison author is application user name.

    Now that you still want old behavior, will you consider sign out when you editing the document? The revision.Author property is readonly, once it's set by Word automatically, people cannot change it programatically.

    I'll forward your requirement to product team, so they may consider add a switch for this behavior in next product release.

    thanks.


    Forrest Guo | MSDN Community Support | Feedback to manager

    • Marked as answer by WordRake Friday, March 8, 2013 6:18 PM
    Friday, March 8, 2013 9:49 AM
    Moderator