Results 1 to 2 of 2
2002-08-01, 15:08 #1
- Join Date
- Nov 2001
- Thanked 0 Times in 0 Posts
Can I save copied document text as a text file? (Word 97)
I am writing a program which parses text within a document and creates then saves a new document for each section of text.
At present, the code looks like this:
Documents(1).SaveAs FileName:="TestDocument" & i & ".doc"
The code is contained within a loop which loops through, parses and saves each section of the document.
The problem I am having is creating a new document for each section of text and saving it is inefficient and slow. If possible, I would like to somehow just save the Section.Copy text as a text file without having to first add a document, copy the text into the new document, then save it.
Is this possible? Any advice would be much appreciated [img]/forums/images/smilies/smile.gif[/img]
2002-08-02, 04:53 #2
- Join Date
- Feb 2001
- Silicon Valley, USA
- Thanked 93 Times in 89 Posts
Re: Can I save copied document text as a text file? (Word 97)
I don't think there's any way to write to a Word document without having it open. However, if you only care about unformatted text, you can blast out text files very quickly using either old-fashioned basic routines or the FileSystemObject.
Here's a bizarre thought: you could create one new document and keep replacing its contents and using .SaveAs rather than adding and closing. Not the pinnacle of elegance, but if it saves half the overhead, why not?