Exporting Inserted Comments (WORD 2000)

D

DanW

Have hundreds of documents with very specifically formatted COMMENTS. Is
there some way to extract/export just comments -- even just to another WORD
doc. Eventually, each field (separated by";" in the Comment) will become an
Excel cell or Access Field record.
Any automation in this process would be helpful. Currently, opening
Comments box, copy/paste to separate doc, search-replace ";" with [TAB] and
expor to Excel.
That's OK -- but not for that many files.
I can work on drafting a macro to do this, but, if one is already out there
somewhere ....
Thanks in advance
Dan
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?RGFuVw==?=,
Have hundreds of documents with very specifically formatted COMMENTS. Is
there some way to extract/export just comments -- even just to another WORD
doc. Eventually, each field (separated by";" in the Comment) will become an
Excel cell or Access Field record.
Any automation in this process would be helpful. Currently, opening
Comments box, copy/paste to separate doc, search-replace ";" with [TAB] and
expor to Excel.
That's OK -- but not for that many files.
I can work on drafting a macro to do this, but, if one is already out there
somewhere ....
Extracting comments to another Word doc wouldn't be too difficult:

Dim s As String
Dim cmt As Word.Comment
Dim doc as Word.Document

For Each cmt In ActiveDocument.Comments
s = s & cmt.Range.Text & vbCr
Next
Set doc = Documents.ADd
doc.Range.Text = s

You could, of course, also write this directly to a text file and open it in
Excel. Or parse it in the macro to an ADO recordset, then put that directly
into Excel. Lots of variations :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
D

Don Catanzaro

Hi Cindy,

I like your code snippet and it works great for me ! I am a newbie (well
non-bie) when it comes to VB code, how can I also get the intials of the
commentor and the page number the comment comes from.

Thanks !

Cindy M -WordMVP- said:
Hi =?Utf-8?B?RGFuVw==?=,
Have hundreds of documents with very specifically formatted COMMENTS. Is
there some way to extract/export just comments -- even just to another WORD
doc. Eventually, each field (separated by";" in the Comment) will become an
Excel cell or Access Field record.
Any automation in this process would be helpful. Currently, opening
Comments box, copy/paste to separate doc, search-replace ";" with [TAB] and
expor to Excel.
That's OK -- but not for that many files.
I can work on drafting a macro to do this, but, if one is already out there
somewhere ....
Extracting comments to another Word doc wouldn't be too difficult:

Dim s As String
Dim cmt As Word.Comment
Dim doc as Word.Document

For Each cmt In ActiveDocument.Comments
s = s & cmt.Range.Text & vbCr
Next
Set doc = Documents.ADd
doc.Range.Text = s

You could, of course, also write this directly to a text file and open it in
Excel. Or parse it in the macro to an ADO recordset, then put that directly
into Excel. Lots of variations :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)


This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 
J

Jezebel

The Object Browser and Intellisense would both lead you to the properties of
the comment object ---

cmt.Initial
cmt.Reference.Information(wdActiveEndPageNumber)



Don Catanzaro said:
Hi Cindy,

I like your code snippet and it works great for me ! I am a newbie (well
non-bie) when it comes to VB code, how can I also get the intials of the
commentor and the page number the comment comes from.

Thanks !

Cindy M -WordMVP- said:
Hi =?Utf-8?B?RGFuVw==?=,
Have hundreds of documents with very specifically formatted COMMENTS.
Is
there some way to extract/export just comments -- even just to another
WORD
doc. Eventually, each field (separated by";" in the Comment) will
become an
Excel cell or Access Field record.
Any automation in this process would be helpful. Currently, opening
Comments box, copy/paste to separate doc, search-replace ";" with [TAB]
and
expor to Excel.
That's OK -- but not for that many files.
I can work on drafting a macro to do this, but, if one is already out
there
somewhere ....
Extracting comments to another Word doc wouldn't be too difficult:

Dim s As String
Dim cmt As Word.Comment
Dim doc as Word.Document

For Each cmt In ActiveDocument.Comments
s = s & cmt.Range.Text & vbCr
Next
Set doc = Documents.ADd
doc.Range.Text = s

You could, of course, also write this directly to a text file and open it
in
Excel. Or parse it in the macro to an ADO recordset, then put that
directly
into Excel. Lots of variations :)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)


This reply is posted in the Newsgroup; please post any follow question or
reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top