473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Strip document name

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
3 1851
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Stanimir Stamenkov | last post by:
Is it possible to make two inline elements to appear adjacent stripping any white space appearing in between in the source? Example: <span class="adj">1</span> <span class="adj">2</span>...
3
by: Eddy C | last post by:
I'm trying to strip an XML document of unwanted nodes such that in the example below I would keep all the parent nodes of a child node I wanted and for other parents which do not have the child...
1
by: Pino Carafa | last post by:
I've designed an aspx page with a Tab Strip on it. The problem is that unlike some of the simpler controls like text boxes and buttons and the likes, this Tab Strip is rendered something like this:...
6
by: Mark Miller | last post by:
I have a scheduled job that uses different XSL templates to transform XML and save it to disk. I am having problems with the code below. The problem shows up on both my development machine (Windows...
2
by: Gustavo Randich | last post by:
Hello, (Using DB2/LINUX 8.2.0) After compiling the STRIP migration UDF (found at http://www-106.ibm.com/developerworks/db2/library/samples/db2/0205udfs/), if I try to execute: values...
4
by: fayez | last post by:
Hi. I have a large Address table, NAME col. is varchar and has titles like: 'MR. ABC and MRS. MMM' want to update to: 'ABC and MMM' 'MR. ABC and MRS. MMM' want to update to be: 'ABC and MMM'...
2
by: CI | last post by:
I have to create a new XML document from the exising one, by adding some additional tags, etc.. My question is as follows: how to strip XML comments from the existing document? The identity...
9
by: amattie | last post by:
Does anyone have any idea on how I can strip the extra whitespace in the XML that shows up when I receive a response from an ASP.NET 2.0 webservice? This has been discussed before, but no one has...
4
by: Poppy | last post by:
I'm using versions 2.5.2 and 2.5.1 of python and have encountered a potential bug. Not sure if I'm misunderstanding the usage of the strip function but here's my example. var = "detail.xml"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.