Page 1 of 3 123 LastLast
Results 1 to 15 of 34
  1. #1
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Macro for Volumes? (MS Word 2003, SP2)

    Hello,

    I have over a hundred chapters (on a network drive) that will be grouped into 4 volumes. There are thousands of references throughout the chapters that need to be updated to something like this:

    Old: Refer to Chapter 200 for further instructions.
    New: Refer to Volume 2, Chapter 200 for further instructions.

    Is it possible to create a MACRO, that will run globally from the folder level?
    Ideally, it would be nice if the Macro could give me the following options:

    Volume 1 for Chapters 100-199
    Volume 2 for Chapters 200-299
    Volume 3 for Chapters 300-399
    Volume 4 for Chapters 400-499

    This would of course save an incredible amount of time, as the only option I see now is to run a Find and Replace in Word, or to buy
    a software application off the web - to do the job.

    I appreciate any assistance that can be provided on this topic.

    Thanks,

    Jim

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    1) Have the references been inserted as fields, or are they plain text?
    2) Are all documents stored in a single folder? If so, does this folder contain other documents than the ones you want to process?

  3. #3
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    Hello Hans,

    The references (e.g. "See Chapter 200 for..." or "Refer to Chapter 200 for..") are plain text right now.
    All of the documents are stored in the same folder.

    Once these references are changed from "See Chapter 200" to "See Volume 2, Chapter 200" - is there a way to make them fields, so that when a PDF is created from all the documents (in the end), I will be to hyperlink to each chapter?

    Thanks,

    Jim

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    Apparently, there are at least two different types of reference: "See Chapter 200 for ..." and "Refer to Chapter 200 for ...". Are there other types? It's important to know exactly what to look for.

  5. #5
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    Hello Hans,

    Yes, we had different writers working on different chapters. The three reference types I currently have are:

    See Chapter 200 for...
    Refer to Chapter 200 for...
    (See Chapter 200)

    I would like to have a Macro that will convert all the references to (See Chapter 200).

    We call our chapters by another name, so I will need to know where to edit the Macro, so that I can change the word "Chapter" to the name that we use.

    Thanks again for your assistance with this topic.

    Jim

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    If you want to change them all to the form (See Chapter 200), what should happen with the "for ..." part from the others? And how can we determine where the ... part ends? Does it always extend to the next period, or ...?

  7. #7
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    Hello Hans,

    Hmm, ok let's keep it simple. I will use an application now (Advanced Find and Replace) to change all the different references to (See Chapter XXXX XX), where XXXX XX represents a chapter number.

    Our chapters are set up in a special way as follows:

    Volume 1

    Chapter 0100 00
    Chapter 0200 00
    Chapter 0300 00

    Volume 2

    Chapter 0400 00
    Chapter 0500 00
    Chapter 0600 00
    Chapter 0700 00

    Volume 3

    Chapter 0800 00
    Chapter 0900 00
    Glossary

    Volume 4

    Foldout Drawings
    FO-1
    FO-2
    FO-3
    FO-4

    So, I will need a Macro that will go through each chapter and add the volume number, based on the chapter number:

    Volume 1, Chapter XXXX XX
    Volume 2, Chapter XXXX XX
    Volume 3, Chapter XXXX XX
    Volume 4, Chapter XXXX XX

    Also I will need to update my foldout references (see FO-1) (See FO-2) (See FO-3) (See FO-4) to the following:

    (See Volume 4, FO-1)
    (See Volume 4, FO-2)
    (See Volume 4, FO-3)
    (See Volume 4, FO-4)

    Thanks,

    Jim

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    If you're already using an external application, can't you use it to add the volume numbers too?

  9. #9
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    Hello again,

    Actually, I was thinking of the wrong external application. I will definitely need a Macro to globally rename the references (plain text) listed in previous post.

    It would be great if the Macro could add the Volume to the front of each respective chapter and then turn the Volume and Chapter reference into a field code. That will (hopefully) preserve all the linking when the chapters are converted to one large PDF.

    Do you know of a Macro that can make this happen?

    Thanks,

    -J

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    I'm a bit lost now. What exactly should the code be looking for? Please enumerate all possibilities.

  11. #11
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    Hello Hans,

    Sorry about the confusion. Please see Post: 671,151.

    In short, I would like to have a Macro, that will search through word documents stored in a network folder.

    The Macro will look through all the word documents (Chapter 0100 00 to Chapter 0999 00) for the reference "See Chapter XXXX XX" The letter X represents a particular chapter number ranging from 0100 00 to 0999 00.

    I would like the Macro to Find and Replace the reference as shown below:

    OLD = "See Chapter 0100 00"
    NEW = "See Volume 1, Chapter 0100 00"

    The Volume number will be automatically generated, based on the chapter number found (e.g. See Volume 1, Chapter 0100 00).

    Please let me know if you have any other questions.

    Thanks,

    Jim

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    The macro in the attached text file hopefully does what you want. Before running it, do the following:
    - Create a new folder.
    - Copy (not move!) the documents you want to process to this folder.
    - Change the constant at the beginning of the macro to the path of the new folder, with a backslash at the end, e.g.

    Const strPath = "C:TestDocs"

    You can now run the macro. If things go wrong, you still have the original documents, so you can start over.
    Attached Files Attached Files

  13. #13
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    Thanks Hans!
    I will give it a try today. I appeciate you taking the time to code this macro for me.

    Regards,
    Jim

  14. #14
    3 Star Lounger
    Join Date
    Jan 2007
    Location
    Massachusetts, USA
    Posts
    272
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    Hello Hans,

    I tried this Macro and it worked partially. The word "Volume" was added to the front of the Chapter reference, but the Volume Number (e.g. 1,2,3,4) was not added.
    Any idea on why?
    I created a folder on my "C" drive (C:TestDocs) and dropped my docs into that test folder.

    Your comments are appreciated.

    Thanks,

    -J

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro for Volumes? (MS Word 2003, SP2)

    The code works with the examples you provided. If the actual references look different, the calculation of the volume number will fail. That's why I asked repeatedly for an exact description of the references.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •