PDA

View Full Version : Retention of formats in split files



Nimrud
03-14-2008, 08:20 AM
I have used the VBA for splitting Word files from lucas' Knowledge Base Item 922 and it does precisely what I want - except - it reformats the text in a fairly basic style.
I am only a beginner with VBA, but would guess that "arrNotes" is only storing the content as text, so all font and table etc info is lost.
If this is the case, is it possible to store the text with formats in another type of storage area?

Alternatively, could the code be rewritten to:
- open the specified source file.
- cut away everything up to the nth marker.
- cut away everything after the n+1th marker.
- store the result in a new file.

TIA

lucas
03-14-2008, 08:41 PM
This has come up before. Take a look at this (http://vbaexpress.com/forum/showthread.php?t=15992) thread which is a discussion on how to change the code you are using to retain formats.

If that doesn't work for you then I have attached another one you might try nimrud. It splits using a style. This one looks for a heading 1 style and splits at that point.