Creating multiple files from a single file 
Author Message
 Creating multiple files from a single file

I am currently working with a client who is wanting a
complicated Wordperfect macro created in Word.  The first
part of the macro converts an ANSI file (tildas, spaces,
and pipes) into field delimited records.  Sometimes there
are several records in one file, so each record is
separated by a pipe.  I have created a macro that performs
this process and also inserts the names of all the
fields.  All of the fields are inserted in the Word
document, separated by commas to indicate they are fields,
so that when the converted ansi text is merged they line
up pretty much with the appropriate field names.  Since
the content is merged against various shell documents,
some fields are left blank, and so on.  The second part of
the procedure is more difficult.  Each record must be
seperated from the one document into its own document and
saved as whatever number is in the second field and the
following three-four fields.  For example, if the second
field is 02, then the file will need to be saved into its
own document called 02*****.doc.  After this, a document
with comments for the relevant fields needs to be inserted
into this document.  After all this, the user will use the
comments as a guide on how to insert the content into the
final shell document.  

If anyone has any suggestions for this procedure,  I would
appreciate the help.  I hope the above message is
reasonably clear.

TIA-Jason



Fri, 02 Dec 2005 22:37:38 GMT  
 Creating multiple files from a single file
If I am not missing something in the translation here, this sounds like a
form letter mail merge, where each record will be merged to a page of its
own. So far so good. The next bit is the splitting of the resulting document
into separately numbered documents by page?
Doug Robbins macro will do that, slightly modified to cater for your
filename structure. You'll need to change the path where indicated as
required.

Sub SplitMerge()
' splitter Macro
' Macro created 16-08-98 by Doug Robbins to save each letter created by a
' mailmerge as a separate file.
' with modifications by Graham Mayor 16-06-03

Dim Title As String
Dim Default As String
Dim MyText As String
Dim MyName As Variant

Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
Default = "Merged"
MyText = "Enter a filename. Long filenames may be used."
Title = "File Name"

MyName = InputBox(MyText, Title, Default)
    If MyName = "" Then
    End
    End If

While Counter < Letters
'   Change the path in the following line to the path you wish to save to.
    Docname = "D:\My Documents\Tests\" & LTrim$(Str$(Counter)) & " " &
MyName

    ActiveDocument.Sections.First.Range.Cut
    Documents.Add
    Selection.Paste
    ActiveDocument.SaveAs FileName:=Docname, FileFormat:=wdFormatDocument, _
    LockComments:=False, Password:="", AddToRecentFiles:=True,
WritePassword:="", _
    ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
        False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
        SaveAsAOCELetter:=False
    ActiveWindow.Close
    Counter = Counter + 1
Wend

End Sub

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
     Graham Mayor -  Word MVP

   Web site www.gmayor.dsl.pipex.com
  Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>

Quote:

> I am currently working with a client who is wanting a
> complicated Wordperfect macro created in Word.  The first
> part of the macro converts an ANSI file (tildas, spaces,
> and pipes) into field delimited records.  Sometimes there
> are several records in one file, so each record is
> separated by a pipe.  I have created a macro that performs
> this process and also inserts the names of all the
> fields.  All of the fields are inserted in the Word
> document, separated by commas to indicate they are fields,
> so that when the converted ansi text is merged they line
> up pretty much with the appropriate field names.  Since
> the content is merged against various shell documents,
> some fields are left blank, and so on.  The second part of
> the procedure is more difficult.  Each record must be
> seperated from the one document into its own document and
> saved as whatever number is in the second field and the
> following three-four fields.  For example, if the second
> field is 02, then the file will need to be saved into its
> own document called 02*****.doc.  After this, a document
> with comments for the relevant fields needs to be inserted
> into this document.  After all this, the user will use the
> comments as a guide on how to insert the content into the
> final shell document.

> If anyone has any suggestions for this procedure,  I would
> appreciate the help.  I hope the above message is
> reasonably clear.

> TIA-Jason



Fri, 02 Dec 2005 23:56:11 GMT  
 Creating multiple files from a single file
Graham,

Yeah, that's pretty much it, but the more I find about
what this client wants, the weirder it seems to program.  
They essentially want two merges.  The first merge will
the multiple records into a shell document that just
contains the fields in no certain form on the page.  
Because each record is different, inevitably fields will
be left entry when merging.  When this is finished, they
need a comments file inserted.  The comments are for the
different departments who will need to enter manual
information into another shell document.  In Wordperfect,
which is how they do things now, it looks like this:
<Comment Box>
ENDFIELD
<Comment Box>
ENDFIELD

I think I will just insert the comments into the shell
document, but it's at this point that each record (which
is still in one file) needs to be split into a file per
record, and this file needs to be named after specific
fields within that record.  This way each department know
what document to look for when they need to merge the data
against their forms. <Breath - this seems so convoluted>

I do think the split merge you sent will work, because
they might be able to type in the name of each new file.

If you have any further assistance, I'd appreciate it.  

TIA - Jason

Quote:
>-----Original Message-----
>If I am not missing something in the translation here,
this sounds like a
>form letter mail merge, where each record will be merged
to a page of its
>own. So far so good. The next bit is the splitting of the
resulting document
>into separately numbered documents by page?
>Doug Robbins macro will do that, slightly modified to
cater for your
>filename structure. You'll need to change the path where
indicated as
>required.

>Sub SplitMerge()
>' splitter Macro
>' Macro created 16-08-98 by Doug Robbins to save each
letter created by a
>' mailmerge as a separate file.
>' with modifications by Graham Mayor 16-06-03

>Dim Title As String
>Dim Default As String
>Dim MyText As String
>Dim MyName As Variant

>Selection.EndKey Unit:=wdStory
>Letters = Selection.Information(wdActiveEndSectionNumber)
>Selection.HomeKey Unit:=wdStory
>Counter = 1
>Default = "Merged"
>MyText = "Enter a filename. Long filenames may be used."
>Title = "File Name"

>MyName = InputBox(MyText, Title, Default)
>    If MyName = "" Then
>    End
>    End If

>While Counter < Letters
>'   Change the path in the following line to the path you
wish to save to.
>    Docname = "D:\My Documents\Tests\" &

LTrim$(Str$(Counter)) & " " &
Quote:
>MyName

>    ActiveDocument.Sections.First.Range.Cut
>    Documents.Add
>    Selection.Paste
>    ActiveDocument.SaveAs FileName:=Docname,

FileFormat:=wdFormatDocument, _
Quote:
>    LockComments:=False, Password:="",

AddToRecentFiles:=True,
Quote:
>WritePassword:="", _
>    ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
>        False, SaveNativePictureFormat:=False,

SaveFormsData:=False, _

- Show quoted text -

Quote:
>        SaveAsAOCELetter:=False
>    ActiveWindow.Close
>    Counter = Counter + 1
>Wend

>End Sub

>--
><>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
>     Graham Mayor -  Word MVP

>   Web site www.gmayor.dsl.pipex.com
>  Word MVP web site www.mvps.org/word
><>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>


>> I am currently working with a client who is wanting a
>> complicated Wordperfect macro created in Word.  The
first
>> part of the macro converts an ANSI file (tildas, spaces,
>> and pipes) into field delimited records.  Sometimes
there
>> are several records in one file, so each record is
>> separated by a pipe.  I have created a macro that
performs
>> this process and also inserts the names of all the
>> fields.  All of the fields are inserted in the Word
>> document, separated by commas to indicate they are
fields,
>> so that when the converted ansi text is merged they line
>> up pretty much with the appropriate field names.  Since
>> the content is merged against various shell documents,
>> some fields are left blank, and so on.  The second part
of
>> the procedure is more difficult.  Each record must be
>> seperated from the one document into its own document
and
>> saved as whatever number is in the second field and the
>> following three-four fields.  For example, if the second
>> field is 02, then the file will need to be saved into
its
>> own document called 02*****.doc.  After this, a document
>> with comments for the relevant fields needs to be
inserted
>> into this document.  After all this, the user will use
the
>> comments as a guide on how to insert the content into
the
>> final shell document.

>> If anyone has any suggestions for this procedure,  I
would
>> appreciate the help.  I hope the above message is
>> reasonably clear.

>> TIA-Jason

>.



Tue, 06 Dec 2005 22:41:52 GMT  
 Creating multiple files from a single file
Frankly I don't know much about Word Perfect, but it seems that this is
what's getting in the way ... the fact that the client has not made the
transition, but wants to carry on doing things the old way.

It sounds, from your description, that the client needs a data file *one
data file* which contains the data that will be selectively merged into
various merge documents.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
     Graham Mayor -  Word MVP

   Web site www.gmayor.dsl.pipex.com
  Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>

Quote:

> Graham,

> Yeah, that's pretty much it, but the more I find about
> what this client wants, the weirder it seems to program.
> They essentially want two merges.  The first merge will
> the multiple records into a shell document that just
> contains the fields in no certain form on the page.
> Because each record is different, inevitably fields will
> be left entry when merging.  When this is finished, they
> need a comments file inserted.  The comments are for the
> different departments who will need to enter manual
> information into another shell document.  In Wordperfect,
> which is how they do things now, it looks like this:
> <Comment Box>
> ENDFIELD
> <Comment Box>
> ENDFIELD

> I think I will just insert the comments into the shell
> document, but it's at this point that each record (which
> is still in one file) needs to be split into a file per
> record, and this file needs to be named after specific
> fields within that record.  This way each department know
> what document to look for when they need to merge the data
> against their forms. <Breath - this seems so convoluted>

> I do think the split merge you sent will work, because
> they might be able to type in the name of each new file.

> If you have any further assistance, I'd appreciate it.

> TIA - Jason
>> -----Original Message-----
>> If I am not missing something in the translation here, this sounds
>> like a form letter mail merge, where each record will be merged to a
>> page of its own. So far so good. The next bit is the splitting of
>> the resulting document into separately numbered documents by page?
>> Doug Robbins macro will do that, slightly modified to cater for your
>> filename structure. You'll need to change the path where indicated as
>> required.

>> Sub SplitMerge()
>> ' splitter Macro
>> ' Macro created 16-08-98 by Doug Robbins to save each letter created
>> by a ' mailmerge as a separate file.
>> ' with modifications by Graham Mayor 16-06-03

>> Dim Title As String
>> Dim Default As String
>> Dim MyText As String
>> Dim MyName As Variant

>> Selection.EndKey Unit:=wdStory
>> Letters = Selection.Information(wdActiveEndSectionNumber)
>> Selection.HomeKey Unit:=wdStory
>> Counter = 1
>> Default = "Merged"
>> MyText = "Enter a filename. Long filenames may be used."
>> Title = "File Name"

>> MyName = InputBox(MyText, Title, Default)
>>    If MyName = "" Then
>>    End
>>    End If

>> While Counter < Letters
>> '   Change the path in the following line to the path you wish to
>>    save to. Docname = "D:\My Documents\Tests\" &
>> LTrim$(Str$(Counter)) & " " & MyName

>>    ActiveDocument.Sections.First.Range.Cut
>>    Documents.Add
>>    Selection.Paste
>>    ActiveDocument.SaveAs FileName:=Docname,
> FileFormat:=wdFormatDocument, _
>>    LockComments:=False, Password:="", AddToRecentFiles:=True,
>> WritePassword:="", _
>>    ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
>>        False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
>>        SaveAsAOCELetter:=False
>>    ActiveWindow.Close
>>    Counter = Counter + 1
>> Wend

>> End Sub

>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
>>     Graham Mayor -  Word MVP

>>   Web site www.gmayor.dsl.pipex.com
>>  Word MVP web site www.mvps.org/word
>> <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>


>>> I am currently working with a client who is wanting a
>>> complicated Wordperfect macro created in Word.  The first
>>> part of the macro converts an ANSI file (tildas, spaces,
>>> and pipes) into field delimited records.  Sometimes there
>>> are several records in one file, so each record is
>>> separated by a pipe.  I have created a macro that performs
>>> this process and also inserts the names of all the
>>> fields.  All of the fields are inserted in the Word
>>> document, separated by commas to indicate they are fields,
>>> so that when the converted ansi text is merged they line
>>> up pretty much with the appropriate field names.  Since
>>> the content is merged against various shell documents,
>>> some fields are left blank, and so on.  The second part of
>>> the procedure is more difficult.  Each record must be
>>> seperated from the one document into its own document and
>>> saved as whatever number is in the second field and the
>>> following three-four fields.  For example, if the second
>>> field is 02, then the file will need to be saved into its
>>> own document called 02*****.doc.  After this, a document
>>> with comments for the relevant fields needs to be inserted
>>> into this document.  After all this, the user will use the
>>> comments as a guide on how to insert the content into the
>>> final shell document.

>>> If anyone has any suggestions for this procedure,  I would
>>> appreciate the help.  I hope the above message is
>>> reasonably clear.

>>> TIA-Jason

>> .



Wed, 07 Dec 2005 01:00:59 GMT  
 Creating multiple files from a single file
Graham,

I concur.  Thanks for confirming my sanity.

-Jason

Quote:
>-----Original Message-----
>Frankly I don't know much about Word Perfect, but it
seems that this is
>what's getting in the way ... the fact that the client
has not made the
>transition, but wants to carry on doing things the old
way.

>It sounds, from your description, that the client needs a
data file *one
>data file* which contains the data that will be

selectively merged into
Quote:
>various merge documents.

>--
><>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
>     Graham Mayor -  Word MVP

>   Web site www.gmayor.dsl.pipex.com
>  Word MVP web site www.mvps.org/word
><>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>


>> Graham,

>> Yeah, that's pretty much it, but the more I find about
>> what this client wants, the weirder it seems to program.
>> They essentially want two merges.  The first merge will
>> the multiple records into a shell document that just
>> contains the fields in no certain form on the page.
>> Because each record is different, inevitably fields will
>> be left entry when merging.  When this is finished, they
>> need a comments file inserted.  The comments are for the
>> different departments who will need to enter manual
>> information into another shell document.  In
Wordperfect,
>> which is how they do things now, it looks like this:
>> <Comment Box>
>> ENDFIELD
>> <Comment Box>
>> ENDFIELD

>> I think I will just insert the comments into the shell
>> document, but it's at this point that each record (which
>> is still in one file) needs to be split into a file per
>> record, and this file needs to be named after specific
>> fields within that record.  This way each department
know
>> what document to look for when they need to merge the
data
>> against their forms. <Breath - this seems so convoluted>

>> I do think the split merge you sent will work, because
>> they might be able to type in the name of each new file.

>> If you have any further assistance, I'd appreciate it.

>> TIA - Jason
>>> -----Original Message-----
>>> If I am not missing something in the translation here,
this sounds
>>> like a form letter mail merge, where each record will
be merged to a
>>> page of its own. So far so good. The next bit is the
splitting of
>>> the resulting document into separately numbered
documents by page?
>>> Doug Robbins macro will do that, slightly modified to
cater for your
>>> filename structure. You'll need to change the path
where indicated as
>>> required.

>>> Sub SplitMerge()
>>> ' splitter Macro
>>> ' Macro created 16-08-98 by Doug Robbins to save each
letter created
>>> by a ' mailmerge as a separate file.
>>> ' with modifications by Graham Mayor 16-06-03

>>> Dim Title As String
>>> Dim Default As String
>>> Dim MyText As String
>>> Dim MyName As Variant

>>> Selection.EndKey Unit:=wdStory
>>> Letters = Selection.Information

(wdActiveEndSectionNumber)

- Show quoted text -

Quote:
>>> Selection.HomeKey Unit:=wdStory
>>> Counter = 1
>>> Default = "Merged"
>>> MyText = "Enter a filename. Long filenames may be
used."
>>> Title = "File Name"

>>> MyName = InputBox(MyText, Title, Default)
>>>    If MyName = "" Then
>>>    End
>>>    End If

>>> While Counter < Letters
>>> '   Change the path in the following line to the path
you wish to
>>>    save to. Docname = "D:\My Documents\Tests\" &
>>> LTrim$(Str$(Counter)) & " " & MyName

>>>    ActiveDocument.Sections.First.Range.Cut
>>>    Documents.Add
>>>    Selection.Paste
>>>    ActiveDocument.SaveAs FileName:=Docname,
>> FileFormat:=wdFormatDocument, _
>>>    LockComments:=False, Password:="",

AddToRecentFiles:=True,
Quote:
>>> WritePassword:="", _
>>>    ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
>>>        False, SaveNativePictureFormat:=False,

SaveFormsData:=False, _

- Show quoted text -

Quote:
>>>        SaveAsAOCELetter:=False
>>>    ActiveWindow.Close
>>>    Counter = Counter + 1
>>> Wend

>>> End Sub

>>> --
>>> <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
>>>     Graham Mayor -  Word MVP

>>>   Web site www.gmayor.dsl.pipex.com
>>>  Word MVP web site www.mvps.org/word
>>> <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>


>>>> I am currently working with a client who is wanting a
>>>> complicated Wordperfect macro created in Word.  The
first
>>>> part of the macro converts an ANSI file (tildas,
spaces,
>>>> and pipes) into field delimited records.  Sometimes
there
>>>> are several records in one file, so each record is
>>>> separated by a pipe.  I have created a macro that
performs
>>>> this process and also inserts the names of all the
>>>> fields.  All of the fields are inserted in the Word
>>>> document, separated by commas to indicate they are
fields,
>>>> so that when the converted ansi text is merged they
line
>>>> up pretty much with the appropriate field names.  
Since
>>>> the content is merged against various shell documents,
>>>> some fields are left blank, and so on.  The second
part of
>>>> the procedure is more difficult.  Each record must be
>>>> seperated from the one document into its own document
and
>>>> saved as whatever number is in the second field and
the
>>>> following three-four fields.  For example, if the
second
>>>> field is 02, then the file will need to be saved into
its
>>>> own document called 02*****.doc.  After this, a
document
>>>> with comments for the relevant fields needs to be
inserted
>>>> into this document.  After all this, the user will
use the
>>>> comments as a guide on how to insert the content into
the
>>>> final shell document.

>>>> If anyone has any suggestions for this procedure,  I
would
>>>> appreciate the help.  I hope the above message is
>>>> reasonably clear.

>>>> TIA-Jason

>>> .

>.



Wed, 07 Dec 2005 02:36:40 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Macro enabling us to insert multiple files into a single word document

2. Using multiple files in single field

3. Inserting multiple files into a single word document - Word97

4. Single File with Multiple forms?

5. Storing a single file on multiple disks

6. Storing a single file on multiple disks

7. Opening multiple .mdb files using a single connection

8. : Thinstall: Create 30-demos and hide all your files in a single EXE

9. ??create single EXE file

10. Any way to create single install file?

11. Create multiple tables from a single query

12. Create multiple tables from a single Make-Table Query

 

 
Powered by phpBB® Forum Software