View Single Post
 
Old 03-30-2020, 08:51 PM
Peterson Peterson is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Jan 2017
Posts: 141
Peterson is on a distinguished road
Default How to create a list of authors

What's the best way to gather a list of all authors in a document (e.g., just like Show Markup > View > Specific People)? Is there a collection of authors that I'm simply not finding? Before writing this question, I was going to put the first author name into a comma-delimited string, find the next author, see if it's in the string and add to it if not, etc., then put the authors into an array, but this seems clunky.

Also, no need to provide code - I'd actually like to write it, but I don't want to stumble through the process, only to discover later that I came up with something convoluted and complex simply because I was unaware of a more elegant method. What follows isn't really anything, just a start, before I thought to ask here:
Code:
Sub GetAllAuthors()

    Dim MyRevision As Revision
    Dim MyComment As Comment
    
    For Each MyRevision In ActiveDocument.Revisions
        Debug.Print MyRevision.Author
    Next
    
    For Each MyComment In ActiveDocument.Comments
        Debug.Print MyComment.Author
    Next
 End Sub
Thanks
Reply With Quote