Results 1 to 15 of 15
  1. #1
    New Lounger
    Join Date
    Aug 2004
    Location
    Marlboro, New Jersey
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Appending documents (Word 2000)

    I have an issue where I need multiple documents appended at one time. I found a macro by Woody called boiler but you need to select a document one by one to add to the list before you can append the documents. I don't know VB so I haven't been able to change the code to what I need it to do. I want it to append all documents in a folder no matter what and it would be nice if it did it for rtf files too. If there isn't a way to get it to do it for rtf files is there a way to convert all the files to .doc files before it does the append? Also since macros are done in VB, can I run the script without being in Word? If i can then that would be nice cause I can run my c# program with the script to make it one automated process. Thanks.

  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Appending documents (Word 2000)

    I don't know Woody's macro or if there is a way of doing this automatically without writing a macro, but I can answer one of your questions - macros in Office are recorded in VBA, Visual Basic for Applications, not VB - and this *is* tied to Office, so no, you wouldn't be able to run it outside of Word. It is possible to write VB scripts that run in Word (I believe, I'm not a VB person) but it's not the norm.

    Re the macro you need, I think it should be possible for one of the real experts in VBA (I'm a mere advanced beginner ...!) to write a sub (macro) that would open each rtf file in Word, use Save As to save it in Word format, then string the .doc contents of the directory together into one big doc - so keep your fingers crossed one of them is feeling benevolent today! <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>
    Beryl M


  3. #3
    New Lounger
    Join Date
    Aug 2004
    Location
    Marlboro, New Jersey
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Appending documents (Word 2000)

    Edited to make url clickable - see <!help=19>Help 19<!/help>

    Well thats disappointing that I can run the macro outside of word but its not the end of the world I guess. Can VBA run programs outside word? If I'm able to do that then maybe I can still automate the process, it would just have to run under the word application. Also his macro is available at this website http://www.gmayor.com/downloads.htm. I don't know how easy it is to change this code but it doesn't look to hard if I had basic knowledge of VB or VBA...which i don't. Hopefully they are feeling benevolent today because I spent a lot of time finding a solution to this and the only thing I found was a really expensive program!

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

    Re: Appending documents (Word 2000)

    Although Word VBA code cannot run outside of Word, you can use Automation to start Word and run Word VBA from other programming languages, such as VB6, Delphi, C++ or C#. But in all cases it requires you to be familiar with Word VBA, and interfacing with it from a non-VB(A) language poses extra challenges. Years ago I did some automation of Word from Delphi, and it was not an easy breeze.

  5. #5
    New Lounger
    Join Date
    Aug 2004
    Location
    Marlboro, New Jersey
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Appending documents (Word 2000)

    Ya thats more effort than I really want considering I don't have much time to do this. The main issue is to get the appending to work right since I could have as much as a hundred files to append and it would be a hassel to append the files one at a time. I wish microsoft just added the feature to append more than one file at once in word from the get go. This doesn't seem like it would be that hard that some people might have wanted to do this.

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

    Re: Appending documents (Word 2000)

    Try the attached (zipped) document. It will try to append ALL files in the folder you specify, so make sure that the folder contains only files that CAN be appended, otherwise the macro will choke.
    Attached Files Attached Files

  7. #7
    New Lounger
    Join Date
    Aug 2004
    Location
    Marlboro, New Jersey
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Appending documents (Word 2000)

    Alright I'm going to sound amaturish but I just started learning about these features of Word...how do I load/run your macro?

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

    Re: Appending documents (Word 2000)

    Unzip the document, then open it. If your macro security level is set to Medium (recommended setting), you will be asked if you want to enable macros. Reply Yes. If your macro security setting is High, you won

  9. #9
    New Lounger
    Join Date
    Aug 2004
    Location
    Marlboro, New Jersey
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Appending documents (Word 2000)

    O sweet nectar thats awesome! Ya my problem was the security settings and it would send me to the editor when I clicked on it. This works great thanks. Also is there a way to make it an add in like the boiler program is so it is a button in the toolbar? I have no problem doing it this way but I'm doing this for a co worker and they are not very computer literate so they might forget to open this file all the time. If not then is there a VB script where I can open Word with this file opened with it. I can then automate it with my program sort of with Alintex so it eliminates a step. Thanks, you've been a big help.

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

    Re: Appending documents (Word 2000)

    You can save the document as a template (.dot) and create a custom toolbar in this template (Tools > Customize...). You can make the InsertLotsOfFiles macro available through a toolbar in this template.
    The user should install this template in his or her STARTUP folder for Word. Next time (s)he starts Word, the toolbar will be displayed. The Word startup folder is specified in Tools > Options..., File Locations tab.

  11. #11
    New Lounger
    Join Date
    Aug 2004
    Location
    Marlboro, New Jersey
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Appending documents (Word 2000)

    One more thing and I'm done. What script line would I need to add to the macro in order to delete all the files in the folder I choose after it is done appending the documents? Since I wont need the original files anymore and it would help me greatly to have this feature part of the macro. Thanks

  12. #12
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Appending documents (Word 2000)

    > What script line would I need to add to the macro in order to delete all the files in the folder I choose after it is done

    MIght I suggest that you not add that? If something were to go wrong, you probably would regret losing all your source files. Instead, maybe you could move all of the files into a "done" subfolder or something like that.

  13. #13
    New Lounger
    Join Date
    Aug 2004
    Location
    Marlboro, New Jersey
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Appending documents (Word 2000)

    Its actually important that I delete these files cause it is generated from another program. I could move it to another folder but it would confuse the person I am doing this for. Nothing important will be lost because all the files that are generated are located in a different folder than the actual important files.

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

    Re: Appending documents (Word 2000)

    Add this instruction near the end of the macro, above Exit Sub:

    <code>Kill strFolder & "*.*"</code>

  15. #15
    New Lounger
    Join Date
    Aug 2004
    Location
    Marlboro, New Jersey
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Appending documents (Word 2000)

    Nevermind I got it. Its the kill command. Thanks anyway.

Posting Permissions

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