Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Appending to File

I've got a large macro which reads an input file, massages it in various
ways, and then writes multiple output files. Here is the code that writes
the output files. The key point is that already existing copies of the
files are simply overwritten.


' Upon reaching the end of the input file, activate each of the output
document files
' in turn and write them out.
If EOF(1) Then
Close #1
'Set MyOpen = Nothing
'iOpen = 0
'GoTo again:
For i = 0 To iNoFiles
Windows(sFileName(i)).Activate
ActiveDocument.SaveAs FileName:=sFileName(i),
fileformat:=wdFormatText
ActiveDocument.Close ' close the document after saving it
Next
End
End If


I would like to be able to append instead of overwrite. IOW, there may be
preexisting copies of any of the sFileName(i) files already on disk. If so,
I don't want to overwrite them, I want to append the new document (in Word)
to the old document (on disk).

I would appreciate any tips (or code) which would guide me in how to do
this. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Appending to File

Thanks for your reply, Tom!

As it happens, this VBA macro has Word origins.

Getting the behavior I'm aiming at is clearly going to be more hassle than I
had hoped. :^(


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
appending one Excel file to another ? George Lewycky Excel Worksheet Functions 2 November 14th 08 07:37 PM
Appending columns Ben Vann Excel Discussion (Misc queries) 5 September 26th 08 11:38 PM
Appending an Excel File to another Wisconsin Excel Discussion (Misc queries) 0 April 14th 08 07:38 PM
Appending a second csv file Rick Excel Discussion (Misc queries) 3 March 9th 05 06:21 PM
Appending Excel file to an Access table Diana[_5_] Excel Programming 1 September 10th 03 08:21 AM


All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"