Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-30-2020, 08:51 PM
Peterson Peterson is offline How to create a list of authors Windows 10 How to create a list of authors Office 2019
Advanced Beginner
How to create a list of authors
 
Join Date: Jan 2017
Posts: 41
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
  #2  
Old 03-30-2020, 09:44 PM
Guessed's Avatar
Guessed Guessed is online now How to create a list of authors Windows 10 How to create a list of authors Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 1,567
Guessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really niceGuessed is just really nice
Default

As far as I know, Word doesn't record the names of everyone who edited the document but it does track a couple of them.

Tracking who created comments or tracked revisions is one way to approach this but it would only get a percentage of those who actually edited the document and rely on those tracked changes and comments still being in the document.

If you go to File>Info you can see Word stores author(s) and last modified by names. So that should be available somewhere. If people were good enough to add themselves as authors in that view you might be getting a reasonable list. But of course it isn't going to be that easy - in practice the author is the person who first saved (or saved as) the file.

You could try investigating this code further - Built In Document Properties seems the best place for author and last edits.
Code:
Sub DocInspect()
  Dim aDI As DocumentInspector, aDP As DocumentProperty
  For Each aDI In ActiveDocument.DocumentInspectors
    Debug.Print aDI.Name
  Next aDI
  On Error Resume Next
  For Each aDP In ActiveDocument.BuiltInDocumentProperties
    Debug.Print aDP.Name, aDP.Value
  Next aDP
End Sub
To comprehensively explore the entire contents of a document to see if the info you want is there, unzip the contents of a docx file that you KNOW multiple people have edited and do a search across all the xml files to see if you can find some of their names somewhere. Don't search for the names that appear as author or last editor as you already know how to get those ones.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 03-30-2020, 11:44 PM
macropod's Avatar
macropod macropod is offline How to create a list of authors Windows 7 64bit How to create a list of authors Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 20,340
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Quote:
Originally Posted by Peterson View Post
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.
Quite effective, really, though I can't see what would be achieved by putting them into an array - the string can already satisfy that need.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
  #4  
Old 04-01-2020, 12:23 PM
Peterson Peterson is offline How to create a list of authors Windows 10 How to create a list of authors Office 2019
Advanced Beginner
How to create a list of authors
 
Join Date: Jan 2017
Posts: 41
Peterson is on a distinguished road
Default

Thank you both for the responses. I wasn't able to get a full author list via DocumentInspector, so I've just gone with looping through the revisions, then looping through the comments; I've also found a function to alphabetize the list, without an array.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a list of authors Word 2013 Referencing - Citations with more than 3 authors Cris4py Word 5 01-05-2017 04:29 AM
How to create a list of authors Simultaneouly edit a document with other authors jaypas Word 5 08-22-2016 09:10 PM
How to create a list of authors Word for Independent Authors - formatting Ray Bright Word 3 06-09-2016 03:16 PM
Using track changes in MSWord, is it possible to have changes done by multiple authors come under th rob1986 Word 1 02-26-2016 05:15 PM
How do you create a list similar to an itunes list? hatemail13 Excel 1 08-06-2010 02:21 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 11:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft