By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

Strip document name

P: n/a
I have a folder which contains *.doc files. What I want to do is strip
out the name of the doc and put the first part in a column in a table and
the second part in another column of the table then move the doc to another
file. Once I have done this I want to go through all the other files doing
the same.
My file name is something like "EX0001-123456"
EX0001 will go in column 1 of tblfiles and 123456 will go in column 2 of the
table.

Can any one help me in the vba required to do this?

Thanks in advance
Dave
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Look at the Dir function in the Help file to retrieve file names from a folder.
Look at the Instr function in the Help file to break the file name into two
parts. Look at the Left, Mid,Right and Len functions in the Help file to
separately get EX0001 and 123456.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Dave" <da***********@btinternet.com> wrote in message
news:c1**********@sparta.btinternet.com...
I have a folder which contains *.doc files. What I want to do is strip
out the name of the doc and put the first part in a column in a table and
the second part in another column of the table then move the doc to another
file. Once I have done this I want to go through all the other files doing
the same.
My file name is something like "EX0001-123456"
EX0001 will go in column 1 of tblfiles and 123456 will go in column 2 of the
table.

Can any one help me in the vba required to do this?

Thanks in advance
Dave

Nov 12 '05 #2

P: n/a
Thanks for your reply, but having done this how do I move on to the next
file?

Dave
"PC Datasheet" <sp**@nospam.spam> wrote in message
news:KF******************@newsread3.news.atl.earth link.net...
Look at the Dir function in the Help file to retrieve file names from a folder. Look at the Instr function in the Help file to break the file name into two parts. Look at the Left, Mid,Right and Len functions in the Help file to
separately get EX0001 and 123456.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Dave" <da***********@btinternet.com> wrote in message
news:c1**********@sparta.btinternet.com...
I have a folder which contains *.doc files. What I want to do is strip out the name of the doc and put the first part in a column in a table and the second part in another column of the table then move the doc to another file. Once I have done this I want to go through all the other files doing the same.
My file name is something like "EX0001-123456"
EX0001 will go in column 1 of tblfiles and 123456 will go in column 2 of the table.

Can any one help me in the vba required to do this?

Thanks in advance
Dave


Nov 12 '05 #3

P: n/a
Dave wrote:
Thanks for your reply, but having done this how do I move on to the next
file?


Call Dir() again with no arguments. As long as that doesn't return ''
you have the next file.

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.