• Showing files that have comments in them (Word 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Showing files that have comments in them (Word 2000)

    Author
    Topic
    #378828

    I’m an editor. Just as a book has chapters, a book project folder has files. Some project folders have 70 or 80 files (lots of little chapters). As I edit each file, I insert comments — the ones with the little yellow stickynotes — to keep track of things I have to research, and the MS isn’t finished until I clean all those up. So anyway, as I clean things up, I delete the comments. When I’m all done, all the comments in all the files are gone. Pretty straightforward.

    Consider, 70 or 80 files, working on a project for a month — by the time the project should be done, little snags in early chapters are long forgotten, and you have to open a file to see if there’s a comment in there. They don’t wave at you from the File Open dialogue box. And so it’s easy to forget that a particular file has a question still hanging fire, and it doesn’t get answered before it’s time to ship off that MS to the graphics department. Sometimes the comment makes it into the galleys — a bad thing! There’s got to be a way to make Word help.

    Can Word display a list of which files in a folder have comments in them? How do I tell it to do that?

    Thanks for your help
    A.

    Viewing 1 reply thread
    Author
    Replies
    • #628440

      I don’t have a direct answer for you. However, in post 133116, the user had a macro that opened documents & deleted graphics. Perhaps it can be modified to search for & report if any comment reference styles exist in a document. I would assume that you delete all the comment reference marks to delete the comments & only use the style for comments.

      You might even want two macros. One for information and one to double check & delete all comments before sending out the documents…in case you missed something. Of course, since I’m not a VBA expert, it’s easy for me to come up with a solution that I can’t carry out. grin

      • #628527

        Editted by Andrew for more resillient code compute and to work for 2000 rather than just XP blush
        (Thanks to post that follows this)

        Try the following – open any file in the target directory and make sure that any changes to it have been saved prior to firing up the Macro.

        The Macro creates a new document containing hyperlinks to all those that contain comments. Hope that helps.

        Option Compare Text
        Option Explicit
        Sub TitlesList()
        ‘ This is a generic routine to obtain a set of files and then generate a document
        ‘ containing Hyperlinks to that set
        ‘ Designed so that simplistic tests of ‘properties to filter’ can select
        ‘ Documents with particular attributes

        Dim FS As Variant
        Dim FO As Variant
        Dim FL As Variant

        Dim ListString As String
        Dim ListStringURL As String
        Dim I As Long
        Dim IMax As Long
        Dim MyTemp As String
        Dim MyDoc As String
        Dim MyPath As String
        Dim DocMustBeOpened As Boolean
        Dim DocWanted As Boolean

        MyPath = Application.Options.DefaultFilePath(wdDocumentsPath)
        If Documents.Count > 1 Then
        If ActiveDocument.Path “” Then
        MyPath = ActiveDocument.Path
        End If
        End If

        ChangeFileOpenDirectory MyPath

        Set FS = CreateObject(“Scripting.FileSystemObject”)
        Set FO = FS.getfolder(MyPath)

        Documents.Add
        MyDoc = ActiveDocument.Name
        DocMustBeOpened = True

        For Each FL In FO.Files
        MyTemp = FL.Name
        If Right(MyTemp, 4) = “.doc” Then
        DocWanted = True
        If DocMustBeOpened Then
        Documents.Open FileName:=MyTemp, ReadOnly:=True, _
        AddToRecentFiles:=False
        If ActiveDocument.Comments.Count = 0 Then
        DocWanted = False
        End If
        ActiveDocument.Close savechanges:=wdDoNotSaveChanges
        End If
        Else
        DocWanted = False
        End If
        If DocWanted Then
        Documents(MyDoc).Hyperlinks.Add Anchor:=Selection.Range, Address:= _
        MyPath & “” & MyTemp, SubAddress:=””
        Documents(MyDoc).Paragraphs.Add
        Selection.MoveDown Unit:=wdParagraph
        End If
        Next
        Set FS = Nothing
        Set FO = Nothing
        End Sub

        • #629109

          Andrew, I’m curious whether you are using XP, because I don’t seem to have an Application.FileDialog object/collection in Word 2000, which obviously presents significant issues for testing the macro.

          Also, you will want to change the ActiveDocument.Close line to:
          ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges

          • #629116

            Oops, and oops

            Yes I’m in XP. Yes, I’ll fix that code blush

            I’d been oscillating around how to open files.
            I’d started with Filesearch but have discovered it can go away for minutes at a time.
            I took to file objects as a last resort, and finally found filedialogue which I liked.
            Given the question was posted for 2000 I’ll modify it and repost a corrected version that’ll run there.

            Thanks for the comments

          • #629204

            Jefferson

            This time … ?

            I ran a test in my version of 2000 – the file opening is kludgy, simply because I don’t know of a neat way to do a user driven directory browse in 2000.

            Any suggestions from anywhere?

            Andrew

            • #629480

              You can use API calls, but there’s also an easier way. Full details are in an “IVB tips” e-mail that I kept when I received it on 8th October this year. You might find the full text by going to http://www.elementkjournals.com/tips.asp and searching for the tip called ‘Leverage the “browse for folder” dialog box from your VB application’.
              In short, you create a project reference to the Microsoft Shell Controls and Automation component (exposed in shell32.dll), and use the BrowseForFolder method of an object set up as “Shell32.Shell”. The tip includes sample code.

            • #629487

              thankyou
              I also found (in parallel) a reference via MVP pages (http://www.bmsltd.ie/mvp/%5B/url%5D) to something Jim Rech had gathered.

              Edited Mar 13th 2004 to update link

    • #628461

      Not wishing to stray out of my depth and appear foolish, I have a low tech solution that may serve as a temporary stopgap. When I am working on pupil records/reports or building up a stock of lessons for a scheme of work, I know that I will need to amend them before the tasks are completed. I tend to save my initial documents with a suffix appended to the filename, e.g atomsU.doc, where the U stands for unfinished. When I return and clean up I resave without the U and delete the original.
      Also, it may be easier to construct a macro that would recognise the suffix.
      Just a suggestion but given in good faith.

      Rob

      • #628485

        Hi Rob:
        Thanks for that idea. I tend to think that the “low tech” solutions are often the best. And there are a number of freeware or shareware renaming utilities (or if you still have winfile.exe, you can rename everything in one fell swoop). Of course, that won’t help determine which files you should rename.

    Viewing 1 reply thread
    Reply To: Showing files that have comments in them (Word 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: