Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filesearch combined with InsertFile

Status
Not open for further replies.

Rzrbkpk

Technical User
Mar 24, 2004
84
US
What I'm attempting to accomplish is to automate a process of looking in a certain directory and combine all of the documents into one. Some quick notes:

-For each document, the data that I need will always reside on page 2.
-The parent directory will always be the same, but the subdirectory will change.

I know that this can be accomplished with a filesearch/InserFile loop. As far as getting the different subdirectoy, I considered using a message box for input.

I'm open to any suggestions.
 
Please confirm...is this for Word?

For future reference, it is always a good idea to state what application your question is for, including version.

If this is for Word, this is not terribly difficult, although you have to explain the mention of page 2.

"combine all of the documents into one"

seems a little conflicting with:

"the data that I need will always reside on page 2"

Which is it? Combining the documents, or getting something from page 2? Or maybe even using whether something IS on page 2 to to decide to combine, or not.

It helps if you are very clear.

FileSearch can use a .TextorProperty parameter to check the actual contents of a file.

It also can check subfolders.

faq219-2884

Gerry
My paintings and sculpture
 
Fumei,
Thanks for looking at this. Yes, it is in Word (2003).

Maybe I need to take one step back. I use a payroll reporting system that spits out multiple reports given a certain time frame. It will produce a single report for each two-week pay period. So if I use a parameter of two months, I'll get four reports. At any rate, each report has a parameter recap on the first page and the actual report on the second page. I want to be able to combine multiple reports into one document.

And before you ask...no, I didn't create the reporting tool and can not get direct access to database. That would make all of this much easier.
 
FileSearch will work fine with 2003, and it will do what you want to do. I think...but it is still not clear what you are trying to do. As I previously stated:

FileSearch can search subfolders. So....what exactly is the problem? I will ask again, please be clear and explicit.

Are you trying to just append the documents from the folders, regardless of content? That is what you would get using InsertFile. Does the content - page 1, or page 2...who cares...drive whether document X is appended, or not?
-For each document, the data that I need will always reside on page 2.
THAT sounds like you want just the data from page 2.

If it is simply taking all the .doc files from Y folder and subfolders and appending them together, this is straightforward.

faq219-2884

Gerry
My paintings and sculpture
 
THAT sounds like you want just the data from page 2.
If it is simply taking all the .doc files from Y folder and subfolders and appending them together, this is straightforward.

Both are correct statements. I will need every document in the folder, but only the second page from each document.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top