P
patti
Hi,
Environment: Windows XP/ home edition; sp2
Office 2000 [no help installed and no cd to install help :-( ]
experience: newbie to vba, c coding experience
This request is free of charge for a friend who would do anything for
anyone. His hard drive of clients was hosed and is able to retrive it from
another source. Unfortunately, the files retrieved are not named properly
and incompatible with his business operations.
Problem description/vba coding segment requested:
Over 60 documents named xxxxxnnnn.doc that contain client info, delimited
with over 65 page breaks. Within each page break contains the client info,
which needs to be extracted into their own word document, and take on the
name: client_name_date_of_service.doc to easily distinguish it.
Relevant client information (including ultimate file name) is contained
within each page break in the larger document. Last record in original file
may not contain the page break, but I'd still like to be able to capture this
one as well.
Filename containing relevant client information should be of the form
client_name_date_of_service.doc (this information is contained within each
page break)
Objective:
- Cycle through all the word documents (approx 60 files) in a given folder
-for each large document file (over 60 files) -- start the splitting
process
- open each file
- for each page break found (between 65 - 80 page breaks)
- for each paragraph in each page break
- capture the first line of each page [this is the client
name]
- for each paragraph [search for the string "date"]
- generate the client name (eg.joe_smith_1_24_07.doc) and
save in a string variable
- capture the entire page
---> including final page break for each page
---- select the contents of this page break and copy the
entire page,
including trailing page break [if absolutely
necessary,]
into client_name_date_of_service.doc.
(eg. joe_smith_1_24_07.doc)
- next [for each page break until no more page breaks in this file
-- note: the final client info. may not contain the trailing
page break,
but I'd still like to be able to capture it and
store it in its proper
clientname_date_of_appt.doc
- next [for each file containing all the client data within the page
breaks]
- close/properly dispose of any allocated resources
- error handler to close/dispose to determine the cause of the failure
and properly shutdown the application.
?? any additional steps that I've neglected to mention.
I enjoy helping people and learning new things. Many thanks to all who
take the time to share their time and talents by responding witih the code
capable of accomplishing this task.
With much gratitude and appreciation,
Patti
Environment: Windows XP/ home edition; sp2
Office 2000 [no help installed and no cd to install help :-( ]
experience: newbie to vba, c coding experience
This request is free of charge for a friend who would do anything for
anyone. His hard drive of clients was hosed and is able to retrive it from
another source. Unfortunately, the files retrieved are not named properly
and incompatible with his business operations.
Problem description/vba coding segment requested:
Over 60 documents named xxxxxnnnn.doc that contain client info, delimited
with over 65 page breaks. Within each page break contains the client info,
which needs to be extracted into their own word document, and take on the
name: client_name_date_of_service.doc to easily distinguish it.
Relevant client information (including ultimate file name) is contained
within each page break in the larger document. Last record in original file
may not contain the page break, but I'd still like to be able to capture this
one as well.
Filename containing relevant client information should be of the form
client_name_date_of_service.doc (this information is contained within each
page break)
Objective:
- Cycle through all the word documents (approx 60 files) in a given folder
-for each large document file (over 60 files) -- start the splitting
process
- open each file
- for each page break found (between 65 - 80 page breaks)
- for each paragraph in each page break
- capture the first line of each page [this is the client
name]
- for each paragraph [search for the string "date"]
- generate the client name (eg.joe_smith_1_24_07.doc) and
save in a string variable
- capture the entire page
---> including final page break for each page
---- select the contents of this page break and copy the
entire page,
including trailing page break [if absolutely
necessary,]
into client_name_date_of_service.doc.
(eg. joe_smith_1_24_07.doc)
- next [for each page break until no more page breaks in this file
-- note: the final client info. may not contain the trailing
page break,
but I'd still like to be able to capture it and
store it in its proper
clientname_date_of_appt.doc
- next [for each file containing all the client data within the page
breaks]
- close/properly dispose of any allocated resources
- error handler to close/dispose to determine the cause of the failure
and properly shutdown the application.
?? any additional steps that I've neglected to mention.
I enjoy helping people and learning new things. Many thanks to all who
take the time to share their time and talents by responding witih the code
capable of accomplishing this task.
With much gratitude and appreciation,
Patti