How can I use VBA to extract a comment/revision Absolute Line - Microsoft Community
- Get link
- X
- Other Apps
i find hard believe, there appears no way extract absolute line number of comment or revision ms word. work extremely large documents (some on 1,000 pages) reviewed hundreds of people on world (this reality of business. not looking creating master file smaller sections nor looking find different way construct or review documents. looking how extract absolute line number document using vba or vb.net.)
my observations after searching several days solution (in random order):
- the object model revisions , comments robust
- the line number beginning of document these objects not stored in model
- word applies line numbers large documents (and must not code-intensive process)
- adding text document line count on recalculates line count based on new text (line count goes or down , readjusted if paragraph inserted, etc.)
- there options restart line number each page, each section, or provide continuously
- the line number available extraction in code top of page
- calculating absolute line number (by counting lines) absurd , flawed approach start, , more when dealing large, graphics-embedded, table-embedded, footnote-embedded documents
- word stores total line count, word count, paragraph count, etc
i have found requests feature dating 2001 (and before in places). why has microsoft not added native features provide this? can't hard modify object model , store information in revision/comment object.
am missing pertinent? available , have been stupid uncover it? if ms cannot provide data, can @ least explain why can't provide data? sorry rant, stupefied on issue.
there no such thing absolute line number in word document , never has been.
as storing such information in revision/comment object, added such an object invalidated subsequent revision situated earlier in document. furthermore, due manner of formatting possibilities, line #s aren't consistent 1 page next. for:
"word stores total line count, word count, paragraph count, etc"
some content doesn't have meaningful line #s (e.g. content in textboxes, headers, footers, endnotes & footnotes). said, can retrieve line # of designated content in body of a specified page, via .information(wdfirstcharacterlinenumber).
for macro export track changes data excel workbook, see:
the code there exports page #s revisions content in document's main text story (body). include corresponding page line #s, might change:
strrev = strrev & vbcr & "page: " & .range.information(wdactiveendadjustedpagenumber) & vbtab & .author & vbtab & .date & vbtab
to:
strrev = strrev & vbcr & "page: " & .range.information(wdactiveendadjustedpagenumber) & "(" & .range.information(wdfirstcharacterlinenumber) & ")" & vbtab & .author & vbtab & .date & vbtab
Office / Word / Microsoft Office Programming / Office 2016
- Get link
- X
- Other Apps
Comments
Post a Comment