Coding Text Using Microsoft Word

Поделиться
HTML-код
  • Опубликовано: 29 июн 2014
  • Describes how to use Word's comment feature to code text and then extract text segments to a table for analysis. The video uses a modified version of a Word macro available at www.thedoctools.com/index.php?...

Комментарии • 130

  • @haiybo
    @haiybo 5 лет назад +7

    I want to thank you Harold. I used your technique recently to code around 40 long transcripts for a project in Afghanistan. It worked without a hitch and saved me a lot of money and time learning a new software. Simple and efficient. I would highly recommend. Cheers

  • @charliehill4033
    @charliehill4033 7 лет назад +4

    This is super helpful and works really well. For anyone wondering why your word document does not have 'extract command' in macros you need to modify your document by downloading the free add-in suggested in the authors description box. Thank you for the instruction it really has helped.

  • @thomassnowjink6068
    @thomassnowjink6068 6 лет назад +4

    Dr Harold. Thank you so much for this video. It actually helped me tremendously in conducting my research thesis.

  • @joeelliott1857
    @joeelliott1857 7 лет назад +16

    How did you edit your macro so that the line number is displayed with the page number, in the table?

  • @perrimoustoukis9260
    @perrimoustoukis9260 4 года назад

    5 years later and still so useful

  • @karenmattes7397
    @karenmattes7397 3 года назад

    Thank you so much! Although I was worried about downloading your Word Macro, it all worked! I followed your video exactly. I have office 365 and this helped me code and sort and do all that I needed for my dissertation!

  • @kirubelmanyazewalmussie1991
    @kirubelmanyazewalmussie1991 6 лет назад +1

    This video is super!!! It solved the problem with the too many codes I have! Thanks a lot!

  • @graenapelanginagara8007
    @graenapelanginagara8007 2 года назад

    Dear Dr. Peach, thank you very much for your video. It helps me to save time and internet data to code data without spend times for learn and spend too much internet data for new analysis software. From hundred videos about coding data on youtube, I fastly understand yours. Thank you!

  • @jameshaskell4175
    @jameshaskell4175 3 года назад +1

    So far the best video on this topic.

  • @MattiasMorrison
    @MattiasMorrison 8 лет назад +1

    Dr. Peach, THANK YOU! I have OS X Word 2011. The initial install didn't work, however I was able to cut/paste the macro from the website, then tweak it for my table column headings. Watching your workflow was been very helpful to me and a few of my classmates.

    • @Dr.KishoreK
      @Dr.KishoreK 5 лет назад

      Do yu have the macro for Lines & Page Nos.? Would you like to share it?

  • @mahmoudassaad8212
    @mahmoudassaad8212 7 лет назад

    Thank you Harold. That was so helpful.

  • @eddiemawer4986
    @eddiemawer4986 4 года назад +4

    Literally saved my dissertation. Thank you

    • @perguto
      @perguto 3 года назад

      just use latex

  • @ladychristina777
    @ladychristina777 7 лет назад

    Thank you very much for the tool Mr. Peach! Very very useful!

  • @respectfaraimugodhi5983
    @respectfaraimugodhi5983 5 лет назад +3

    Thank you so much for this. Helped me in my hour of need

  • @Hotaruu
    @Hotaruu 6 лет назад

    Great for expert interviews with a small sample size like mine (N = 20). Thank you so much for sharing.

  • @simulationdeveloper6702
    @simulationdeveloper6702 7 лет назад +1

    Thanks Harold! I would LOVE to know if I could code my Themes in the Comments area in a way that - after extracting them into a table - would put the categories across the top and the variables down the left side? As a very low-tech user, I can just manage to create graphs from tables in Word, but I can't get my codes into the tables automatically (only manually). If you know how I could use commas or paragraph markers etc. to automatically place my Comments in the right parts of table, it would let me stay in Word for all my coding and graph production.

  • @cynthiaa.4826
    @cynthiaa.4826 7 лет назад

    Thank you. I've found the information very useful.

  • @tewogbadeabegunde1625
    @tewogbadeabegunde1625 6 лет назад

    Dr Harold, thanks so much for this video. It worked! God bless you real good.

  • @fonyuy4441
    @fonyuy4441 5 лет назад

    Hello Harold, Thank You so much. That was 100% helpful to me.God Bless You

  • @alejandroayos3489
    @alejandroayos3489 2 года назад

    Thanks, mate. U save time, pain, and is just beautiful, Harold

  • @haroldpeach2926
    @haroldpeach2926  9 лет назад

    I have not personally tested this, but I believe it works in Word 2010 for the Mac, but not in earlier versions.

  • @admiRED69
    @admiRED69 8 лет назад +2

    Hi Harold great tutorial, as I am a novice to coding transcripts. I have got the macro working on my mac but for some reason it doesn't extract the textual data that I have selected for the comment.
    Did you make a change to the macro to include this?

  • @1000nicolene
    @1000nicolene Год назад

    Thank you for the tutorial and the provided link. I found your explanation and instructions very useful.

  • @dr.maanpascua1566
    @dr.maanpascua1566 11 месяцев назад

    Very informative Dr. Harold. I am looking for a video like this that is easy to understand.

  • @tadessemegersa8181
    @tadessemegersa8181 3 года назад

    enjoyed your lecture! thank you

  • @magaroonie13
    @magaroonie13 2 года назад

    Hi, Dr. Peach - thank you so much for posting this video and sharing the link to the macro. Quick question - when I review the macro code, I do not see the "line number" in with the location (page number). Can you help? I get to do multiple layers of coding for my Capstone Project and it would be really helpful. Thank you!

  • @Beaugeek3
    @Beaugeek3 4 года назад

    what would be considered small scale? I have 11 interviews and I bought Nvivo but short on time to learn the software right now for my pilot data. I'm thinking I will need to learn it later when I get my actual data.

  • @witneyh9353
    @witneyh9353 3 года назад

    Thank you!! This is very useful and will be helping us with our Bachelors project

  • @Koos1962
    @Koos1962 7 лет назад

    Great, thank to al reviews i find the solution.

  • @Chukurization
    @Chukurization 9 лет назад

    Really useful. Thanks

  • @MonjiGhanem
    @MonjiGhanem 4 года назад

    Great ... very helpful
    Thank U very much

  • @Musicsinger299
    @Musicsinger299 5 лет назад

    What classifies as small scale research? Would 15-20 interviews be considered large-scale?

  • @Laurax12345
    @Laurax12345 8 лет назад

    Hello, I have a problem :( using word 2011 for mac, when I want to run the macro on my document it gives me an error : Compile error in hidden module: DED_ExtractComments what should I do??

  • @Dr.KishoreK
    @Dr.KishoreK 5 лет назад

    Its a good technique for content analysis. Do you think this technique can be used for PhD projects?

  • @chrisbyrne9721
    @chrisbyrne9721 6 лет назад

    Brilliant I love it thanks :-)

  • @naheedarshad5896
    @naheedarshad5896 8 лет назад

    hello Harold have just worked it out using doc tools. but my extracted data is page numbers. can't change it any other way how can i do this? even when i put line numbers in original document it still only extracts to show page numbers. please advice

  • @kimsornngam105
    @kimsornngam105 7 лет назад

    What version are you using in presentation? I followed but once I macros it there was no file in it feature. What can I do? Your presentation is really helpful for my career.

  • @charithsuranga1
    @charithsuranga1 6 лет назад

    Hi guys
    I did comments and tries use macros to extract comments in new doc. New doc is not creating. Can anyone help me? Read all comments tried but not work? any advice ?

  • @bobvictor1962
    @bobvictor1962 2 года назад

    Is there a way to set word references like in Excel. For Example, I have a Template which uses text to describe things, like a movie title, number of theaters, and P&A Budget. Like this: "Galaxia will be released in 500 theaters with a P&A Budget of $500.00 per theater." Is there a way (without find and replace) to use a code for each, i.e. MovieTitle, NumTheaters, P&ABudget and insert the code words into the text so that wherever the code word appears, it will insert the text value of the code word? This way, I can simply change the value of the code word and all entries in the document will update automatically.

  • @kangimampamungkas577
    @kangimampamungkas577 Год назад

    Hi Dr. Harold. Thanks for sharing the videos. Just wanna ask you how to extract comments to macro? I watched your video (Coding Text Using Microsoft Word) but I couldn't do it when I do in my file. Could you help me with this?

  • @bellamarble1256
    @bellamarble1256 2 года назад

    Thank you this is very helpful

  • @naheedarshad5896
    @naheedarshad5896 8 лет назад

    hello harold i am not good with computers. but i think someone has posted a code in comments. i have transcribed my interview and coded with comments as advised . i need to extract the comments from my word document into a new document. can you advise me step by step how to do this. i would be very grateful. thank you

  • @MegaKach
    @MegaKach 6 лет назад

    Dear Dr. Harold, thank you very much for this video. I have been struggling with but you have come to my rescue.Please, do you have a video on how to use the Nvivo?

  • @fifitherapy
    @fifitherapy 6 месяцев назад

    This is very helpful thank you.

  • @itsyoussef
    @itsyoussef 7 лет назад

    Great. Thank you.

  • @SCAScienceLab
    @SCAScienceLab 9 лет назад +4

    the version on the doctools.com does not have the code for line number. Is there a way to add it easily?

  • @priscillakora7465
    @priscillakora7465 7 лет назад

    Hello,
    Wonderful video, but i couldn't execute it because i didn't have the right macro. do you have a special macro for the extraction of the comments?
    Thanks

  • @MegaKach
    @MegaKach 6 лет назад

    hello... please, can coding be also called categorizing???

  • @sweetrambutan
    @sweetrambutan 3 года назад

    Thank you very much sir.

  • @doraduan3379
    @doraduan3379 7 лет назад +4

    Hi, Harold, My Word couldn't run the macro. I create the name for the macro as 'ExtractCommentsToNewDoc', and then I click 'Run', but no new doc. was created. Could you help me?

    • @HarerimanaAlexis
      @HarerimanaAlexis 6 лет назад

      I experienced the same problem.

    • @user-ot7es3ly9t
      @user-ot7es3ly9t 5 лет назад +1

      hi
      i found that we have to "build" a new macro at the first time.
      This website can help us. www.thedoctools.com/word-macros-tips/word-macros/extract-comments-to-new-document/
      It already have the ''extract macro" code. (www.thedoctools.com/downloads/basComments_Extract.htm
      We can just copy and paste the code when we start this new macro.
      Many thanks to this website.

    • @BoBo-nd2pj
      @BoBo-nd2pj 5 лет назад

      @@user-ot7es3ly9t that really helps! thank you so much for sharing this!

  • @joelogwe1713
    @joelogwe1713 2 года назад

    Could you explain how you coded your macro?

  • @tomlynch3749
    @tomlynch3749 6 лет назад

    worked great

  • @mriaz5228
    @mriaz5228 7 лет назад

    this is a useful macro - does anyone know how to add a page number in the footer of the new document? thanks

  • @meddodzi7
    @meddodzi7 2 года назад

    Why can't I see all the macros in the macros name option? How can I make it to be active?

  • @pierspearson6525
    @pierspearson6525 7 лет назад +1

    Brilliant help. It won't let me run though?

  • @sandynarsh
    @sandynarsh 2 года назад +1

    After clicking on run, the window "do you want to extract comments to new document?" does not appear. Anyone who can help please

  • @karenstovall3842
    @karenstovall3842 7 лет назад

    This is an excellent video and i have read the comments below and I used to write code for computers however, I am lost. Can you help?

  • @allystar2665
    @allystar2665 2 года назад

    Where can I get the macro from and how do I use??

  • @thomaserler3556
    @thomaserler3556 6 лет назад

    Hi, WHO CAN HELP to implement and use this macro in WORD for MAC 2011. Unfortunately I am not experienced in working with macros... Thank you very much in advance !!!!

  • @kayleemak6260
    @kayleemak6260 3 года назад

    Very useful tool there. =) Life saver for my upcoming qualitative assignment.

  • @jessicaguarnero1776
    @jessicaguarnero1776 2 года назад

    OMG, thank you.

  • @dago130
    @dago130 4 года назад

    How do you get the line number in the new document? For me it is only showing the page number.

    • @amandapp2881
      @amandapp2881 4 года назад

      Here too, everything else worked perfectly , would be great to get a hint to get the line numbers into the extracted document. Thanks for sharing !

  • @dr.oscarmostofi2999
    @dr.oscarmostofi2999 7 лет назад

    Where is the coding macro? When I view the macro, there is none.

  • @ammarshauqi
    @ammarshauqi 4 года назад

    How to get the coding microsoft words tempplate? help me

  • @Krishnakumarkodungallur
    @Krishnakumarkodungallur 3 года назад

    Thank you sir

  • @callezey6786
    @callezey6786 4 года назад

    Im not sure why I cant see Extract option in my macros. Anyone knows how to settle this issue?

    • @oscarocampo6712
      @oscarocampo6712 3 года назад

      in the description of the video the Dr harold add a link you need check it there is the code of the macro and how you embeed it in Word, i happend the same that you but Jorge Roa discovered the trick.

  • @PatrickKaeslin
    @PatrickKaeslin 8 лет назад +1

    Hi Harold, this is a great presentation of coding. Would you mind to present your modified version of this word macro? Thanks in advance.

    • @haroldpeach9321
      @haroldpeach9321 8 лет назад

      +Patrick Kaeslin unfortunately the code was written by someone else (see above). I only modified the code. For this reason, I do not have permission to post the code. Sorry.

    • @PatrickKaeslin
      @PatrickKaeslin 8 лет назад +2

      +Harold Peach thank you very much for your reply. As you mentoined to Dionne " 'Line number
      .Cells(2).Range.Text = oDoc.Comments(n).Scope.Information(wdFirstCharacterLineNumber)" that something I was looking for. Thanks again!

    • @gllee2044
      @gllee2044 8 лет назад

      Patrick, where should the modification be made? I tried using the Edit feature and added the line above but it didn't work. Appreciate your guidance. Thanks.

    • @Koos1962
      @Koos1962 7 лет назад

      When I perform this modification, the line number appears (great) but the comments disappears.

    • @mgcains
      @mgcains 7 лет назад +7

      Hello Koos. I modified the macro to include the line number and retain the comments section. The original code only had five columns created so a sixth column must be created to allow for the line number to be added.
      Below after the *** is the modified macro with line number AND comments.
      ***
      Public Sub ExtractCommentsToNewDoc()
      '=========================
      'Macro created 2007 by Lene Fredborg, DocTools - www.thedoctools.com
      'Revised October 2013 by Lene Fredborg: Date column added to extract
      'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
      'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
      '=========================
      'The macro creates a new document
      'and extracts all comments from the active document
      'incl. metadata
      'Minor adjustments are made to the styles used
      'You may need to change the style settings and table layout to fit your needs
      '=========================
      Dim oDoc As Document
      Dim oNewDoc As Document
      Dim oTable As Table
      Dim nCount As Long
      Dim n As Long
      Dim Title As String
      Title = "Extract All Comments to New Document"
      Set oDoc = ActiveDocument
      nCount = ActiveDocument.Comments.Count
      If nCount = 0 Then
      MsgBox "The active document contains no comments.", vbOKOnly, Title
      GoTo ExitHere
      Else
      'Stop if user does not click Yes
      If MsgBox("Do you want to extract all comments to a new document?", _
      vbYesNo + vbQuestion, Title) vbYes Then
      GoTo ExitHere
      End If
      End If
      Application.ScreenUpdating = False
      'Create a new document for the comments, base on Normal.dotm
      Set oNewDoc = Documents.Add
      'Set to landscape
      oNewDoc.PageSetup.Orientation = wdOrientLandscape
      'Insert a 6-column table for the comments
      With oNewDoc
      .Content = ""
      Set oTable = .Tables.Add _
      (Range:=Selection.Range, _
      NumRows:=nCount + 1, _
      NumColumns:=6)
      End With
      'Insert info in header - change date format as you wish
      oNewDoc.Sections(1).Headers(wdHeaderFooterPrimary).Range.Text = _
      "Comments extracted from: " & oDoc.FullName & vbCr & _
      "Created by: " & Application.UserName & vbCr & _
      "Creation date: " & Format(Date, "MMMM d, yyyy")
      'Adjust the Normal style and Header style
      With oNewDoc.Styles(wdStyleNormal)
      .Font.Name = "Arial"
      .Font.Size = 10
      .ParagraphFormat.LeftIndent = 0
      .ParagraphFormat.SpaceAfter = 6
      End With
      With oNewDoc.Styles(wdStyleHeader)
      .Font.Size = 8
      .ParagraphFormat.SpaceAfter = 0
      End With
      'Format the table appropriately
      With oTable
      .Range.Style = wdStyleNormal
      .AllowAutoFit = False
      .PreferredWidthType = wdPreferredWidthPercent
      .PreferredWidth = 100
      .Columns.PreferredWidthType = wdPreferredWidthPercent
      .Columns(1).PreferredWidth = 5
      .Columns(2).PreferredWidth = 5
      .Columns(3).PreferredWidth = 20
      .Columns(4).PreferredWidth = 40
      .Columns(5).PreferredWidth = 18
      .Columns(6).PreferredWidth = 12
      .Rows(1).HeadingFormat = True
      End With
      'Insert table headings
      With oTable.Rows(1)
      .Range.Font.Bold = True
      .Cells(1).Range.Text = "Page"
      .Cells(2).Range.Text = "Line"
      .Cells(3).Range.Text = "Comment scope"
      .Cells(4).Range.Text = "Comment text"
      .Cells(5).Range.Text = "Author"
      .Cells(6).Range.Text = "Date"
      End With
      'Get info from each comment from oDoc and insert in table
      For n = 1 To nCount
      With oTable.Rows(n + 1)
      'Page number
      .Cells(1).Range.Text = oDoc.Comments(n).Scope.Information(wdActiveEndPageNumber)
      'Line number
      .Cells(2).Range.Text = oDoc.Comments(n).Scope.Information(wdFirstCharacterLineNumber)
      'The text marked by the comment
      .Cells(3).Range.Text = oDoc.Comments(n).Scope
      'The comment itself
      .Cells(4).Range.Text = oDoc.Comments(n).Range.Text
      'The comment author
      .Cells(5).Range.Text = oDoc.Comments(n).Author
      'The comment date in format dd-MMM-yyyy
      .Cells(6).Range.Text = Format(oDoc.Comments(n).Date, "dd-MMM-yyyy")
      End With
      Next n
      Application.ScreenUpdating = True
      Application.ScreenRefresh
      oNewDoc.Activate
      MsgBox nCount & " comments found. Finished creating comments document.", vbOKOnly, Title
      ExitHere:
      Set oDoc = Nothing
      Set oNewDoc = Nothing
      Set oTable = Nothing
      End Sub

  • @kridawidajati3934
    @kridawidajati3934 3 года назад

    I failed to did that after the adding comment steps. Is there anyone who could help me to solve my problem ?

  • @camilodaza715
    @camilodaza715 4 года назад

    Wonderful! I really appreciate this video. I was desperately trying to use opencode while you have an easier access tool.

  • @dr.yanghong6816
    @dr.yanghong6816 5 лет назад

    Good help

  • @bartooma
    @bartooma 2 года назад

    Do you give online private classes?

  • @SCAScienceLab
    @SCAScienceLab 9 лет назад +1

    I need! How do I download this macro? I can't figure it out!

    • @SCAScienceLab
      @SCAScienceLab 9 лет назад

      I figured it out and I am rocking and rolling! Thanks!

    • @SDRio
      @SDRio 8 лет назад

      +Camila Torres I can't figure it out how to download this! Can someone help??

    • @naheedarshad5896
      @naheedarshad5896 8 лет назад

      Camila can you advise me step by step how did you do this not good with computers. i have transcribed my interview, coded with comments but need to extract the comments on a separate word document. please help

    • @ellieshokri2011
      @ellieshokri2011 6 лет назад

      Could you please help me to figure out how I can add line number to the Extracting Macro?

  • @nayaabhussain7798
    @nayaabhussain7798 3 года назад

    I can't seem to get the line numbers to show up! Can anyone help me?

  • @ntshizam6601
    @ntshizam6601 6 лет назад

    Great explanation. Thanks. Anyone requiring help with the macro, give me a shout. Managed to get it working

    • @gracemwaura
      @gracemwaura 5 лет назад

      Trying to get it work on Mac. Kindly help

    • @iriszhang8068
      @iriszhang8068 5 лет назад

      There is no selection called 'ExtractCommentsToNewDoc' in the Macro as the video showed, Would you please help me?

    • @imranaqasim3058
      @imranaqasim3058 4 года назад

      HI. Mne does not extract comments in a new file, whats wrong

  • @dionnebarnes-proby5770
    @dionnebarnes-proby5770 8 лет назад

    How do you get the line numbers in the table? The are not included in the macro.

    • @haroldpeach9321
      @haroldpeach9321 8 лет назад +1

      +Dionne Barnes-Proby
      'Line number
      .Cells(2).Range.Text = oDoc.Comments(n).Scope.Information(wdFirstCharacterLineNumber)

    • @gllee2044
      @gllee2044 8 лет назад

      Dr Harold, where should the modification be made? I tried using the Edit feature and added the line above but it didn't work. Appreciate your guidance. Thanks.

    • @mariaalonso5553
      @mariaalonso5553 7 лет назад +1

      Hello Harold! I'm currently going through the same productive struggle as Samantha. Can you tell me where exactly I have to add 'Line number
      .Cells(2).Range.Text = oDoc.Comments(n).Scope.Information(wdFirstCharacterLineNumber)?
      This is such a great resource! I'm was feeling overwhelmed with my mixed methods data analysis. I'll be sharing this gem of knowledge with my classmates. Thank you!!!

    • @theOAUE
      @theOAUE 7 лет назад +1

      +Harold Peach, thank you for the video! Super helpful.
      But can you or anyone tell us where to enter this?
      'Line number
      .Cells(2).Range.Text = oDoc.Comments(n).Scope.Information(wdFirstCharacterLineNumber)

    • @Slappingplastic
      @Slappingplastic 7 лет назад

      But where is the problem.

  • @BilalAhmad-xq4rw
    @BilalAhmad-xq4rw 4 года назад

    i Could not get macro output after following your steps

  • @patricebarrett5845
    @patricebarrett5845 3 года назад

    I just want to comment on the loudness of the mic. I don't have to have an external speaker to hear him loud and clearly.

  • @mahaalsheikhsoleiman3351
    @mahaalsheikhsoleiman3351 7 лет назад

    Thanks very useful. I used the link mentioned by Mad5cout and it worked

  • @seabongarose2922
    @seabongarose2922 3 года назад

    Enlightenment

  • @yogeshsatray168
    @yogeshsatray168 9 лет назад

    hi i find this video very useful. Thank you for uploading. but i am unable to use this feature in my Document. does it require any macro to download. i have no clue. kindly help

    • @haroldpeach2926
      @haroldpeach2926  9 лет назад

      Yogesh S Atray Yes, See the description above for a link to the original macro. You will need to add this macro to your Word document and modify it to meet
      your specific needs.

    • @gokcenbulut
      @gokcenbulut 9 лет назад

      Harold Peach The link is empty; can you recommend another one to be used in Mac as well? By the way the video is quite useful that thank you for it!!

  • @Sagarsmkb
    @Sagarsmkb 7 лет назад

    very useful but it did not work for my document.

  • @tetyaraksmeyket4283
    @tetyaraksmeyket4283 7 месяцев назад

    Why can't I extract the comment? It doesn't work for me :(

  • @Koos1962
    @Koos1962 7 лет назад +1

    Great thanks, but it does not show the line number

  • @riceball100
    @riceball100 9 лет назад

    I guess this only works for Windows, but not Mac...I couldn't get it to work

    • @haroldpeach9321
      @haroldpeach9321 8 лет назад

      +Dana Ng it should work with the latest version of Office for the Mac, but not with older versions.

  • @bebeokoli
    @bebeokoli 5 лет назад

    I've been trying this for days and it never worked, even when I followed the step by step instructions

  • @oscarocampo6712
    @oscarocampo6712 3 года назад

    why you didnt explain the first part of how use the macro in MS will be more easy , my friend Collins couldnt sleep last night trying to understand the tutorial

  • @ayses3851
    @ayses3851 2 года назад +1

    So if you want to make an excel sheet with page number, line number, author, time comment was made, comment and reference text you can use this :
    Sub ExportComments()
    ' Note: A reference to the Microsoft Excel # Object Library is required, set via Tools|References in the Word VBE.
    Dim StrCmt As String, StrTmp As String, i As Long, j As Long, xlApp As Object, xlWkBk As Object
    StrCmt = "Page,Line,Author,Date & Time,Comment,Reference Text"
    StrCmt = Replace(StrCmt, ",", vbTab)
    With ActiveDocument
    ' Process the Comments
    For i = 1 To .Comments.Count
    With .Comments(i)
    StrCmt = StrCmt & vbCr & .Reference.Information(wdActiveEndAdjustedPageNumber) & vbTab
    StrCmt = StrCmt & .Reference.Information(wdFirstCharacterLineNumber) & vbTab & .Author & vbTab
    StrCmt = StrCmt & .Date & vbTab & Replace(Replace(.Range.Text, vbTab, ""), vbCr, "")
    StrCmt = StrCmt & vbTab & Replace(Replace(.Reference.Text, vbTab, ""), vbCr, "")
    End With
    Next
    End With
    ' Test whether Excel is already running.
    On Error Resume Next
    Set xlApp = GetObject(, "Excel.Application")
    'Start Excel if it isn't running
    If xlApp Is Nothing Then
    Set xlApp = CreateObject("Excel.Application")
    If xlApp Is Nothing Then
    MsgBox "Can't start Excel.", vbExclamation
    Exit Sub
    End If
    End If
    On Error GoTo 0
    With xlApp
    Set xlWkBk = .Workbooks.Add
    ' Update the workbook.
    With xlWkBk.Worksheets(1)
    For i = 0 To UBound(Split(StrCmt, vbCr))
    StrTmp = Split(StrCmt, vbCr)(i)
    For j = 0 To UBound(Split(StrTmp, vbTab))
    .Cells(i + 1, j + 1).Value = Split(StrTmp, vbTab)(j)
    Next
    Next
    .Columns("A:D").AutoFit
    End With
    ' Tell the user we're done.
    MsgBox "Workbook updates finished.", vbOKOnly
    ' Switch to the Excel workbook
    .Visible = True
    End With
    ' Release object memory
    Set xlWkBk = Nothing: Set xlApp = Nothing
    End Sub

  • @TheMre3010
    @TheMre3010 5 лет назад

    This tutorial will make no sense to those who do not know what macro is, so do yourselves a favour and understand the basic functions of the macro.

    • @TheMre3010
      @TheMre3010 5 лет назад

      finally! so basically, you gotta paste the ready-made macro (in the bio) in your visual basic to actually extract the comments! thanks a lot!

    • @TheMre3010
      @TheMre3010 5 лет назад

      Well after an extensive amount of trial and error, I finally figure out the case of adding "line number". To include the line number just simply replace the 'author' line code with this code since I find it irrelevant to have such column on that;
      'Line number
      .Cells(4).Range.Text = oDoc.Comments(n).Scope.Information(wdFirstCharacterLineNumber)
      please be reminded to edit (.Cells(4).Range.Text = "Author") in the insert heading section and change "author" to "line number" otherwise your "author" column will not change to "line number". I hope this helps.