Reading file names of PDF's and comparing it with access database

daze

Registered User.
Local time
Today, 06:28
Joined
Aug 5, 2009
Messages
61
I have one unusual problem to solve…
There are a lot of PDF files (over 160) with unique name (Spec_385912347657_200909) that are actually phone bills that need to emailed to a customer in database.
I need access to disregard first 5 and last 7 characters, do the check within the database, and sends email with attached correct pdf.
So my question is can I do it through access (and how) or not?
I'm not big VBA user, but if you give me some guidance, I'd appreciate.
 
To extract the portion of the string you need to use a simple function

Code:
Public Function ExtractAccountNo(FileName As String) As String


FileName = Mid(FileName,6) 'Drop the Prefix
FileName = Left(FileName,Len(FilleName)-11) 'Drop the suffix [B]and the dot and the Extension[/B]
ExtractAccountNo = FileName

End Function


David
 
Last edited:

Users who are viewing this thread

Back
Top Bottom