joining two files as one 
Author Message
 joining two files as one

I have a repetitive task of joining a file with three hundred+ other files.
Copy and paste the first into the 300+ other files and have them save as the
file name plus the word "done".

ex. warning.doc + mary.doc becomes "maryDone.doc"

Anybody?  Help!



Sun, 30 Mar 2003 03:00:00 GMT  
 joining two files as one
Yeah, that should be fairly simple, as long as your 300+ files are in a
somewhat coherent arrangement. You have several distinct task to perform,
and none of them are particularly involved.

1. Open your warning file by hand - that's easiest.

2. In your macro, use DIR to specify a string which will locate all your
files. If they're named Mary001.doc to Mary300.doc, then "Mary???.doc" will
do it. If they have random names, but are all in one folder, then
"C:\whateverfolder\*.doc" will work. Since I don't know the specs on these
files, you'll have to set that up yourself.

3. Then run your code something like this:
*** Warning - this is not tested code - these are rough instructions ***
Documents("Warning.doc).Range.Copy
Dir "Mary???.doc"
Do
    x$ = Dir
    If x$ = "" Then Exit Loop
    Documents.Open x$
    ' Move your selection to beginning, end or wherever (you didn't say
where you wanted the warning)
    Selection.Paste
    ActiveDocument.SaveAs Left$(x$,instr(1,x$,".")-1) + "Done.doc" '
Assuming all your stuff has the ext. of doc
    ActiveDocument.Close
Loop

If this is something that will happen often, or other people will use, then
you will want to doll it up a little.
If it's a one-timer, this should do you just fine.
One warning: you might want to put your output into a different folder, so
you can wipe it easily if your first try doesn't produce quite what you
want. In that case, use ...SaveAs "C:\otherfolder\" + Left$(x$....

Petr


P?edmt: joining two files as one
Datum: 11. ?jna 2000 16:43

I have a repetitive task of joining a file with three hundred+ other files.
Copy and paste the first into the 300+ other files and have them save as the
file name plus the word "done".

ex. warning.doc + mary.doc becomes "maryDone.doc"

Anybody?  Help!



Sun, 30 Mar 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Join two recordsets into one using DAO 3.6?

2. Join two value into one variable

3. help i need to join two or more tables to one

4. Two joins in one sql statement?

5. Merge two wave file one after one

6. Joining two tables from two databases

7. Here's a sticky wicket - joining two tables on two diffrent servers with ADO

8. Joining two text files

9. Wav files; joining two together

10. Join two MDB files

11. Urgent: concaténner 2 fichiers en VB6/ Join two files in VB6

12. Joining Two AVI Files

 

 
Powered by phpBB® Forum Software