create & record word document filenames

jonesey

New member
Local time
Today, 12:11
Joined
Apr 11, 2009
Messages
4
SOLVED found what i need in Access 2007 VBA Bible sample files

Hi
I want to use a database to create& record word document filenames. The idea is that everyone creating a document would have to do it from the database to force the use of correct filenames - which doesn't happen now. Our rules are that files have a 2 or 3 letter preset customer reference, a 3 digit code to represent the type of document such as 500 for bills, 200 for sales letters and so on, and a sequential number by customer reference. This is a legacy naming system changing it would be messy. So, document names look like ABC_500_001.doc, JB_500_001.doc. We have never needed more than 50 or so documents for any one customer, so 999 is more than enough.

i'd pictured an unbound form with combo boxes to choose the customer ref and document-type ref. Prob a command button to run the code to create the new filename as the primary key of next record in the documents table and open a form showing the new record, for remaining fields to be completed manually. Then another button on the documents form to click to create and open a new word document with that filename.

i have been lent a VB book and think I can see how to do string manipulation to make the filename form the combo box data and existing records in the table, but not how to get the result into a new record in a table. i don't even know if the final bit - starting a new word document with the right filename - is doable.

if anyone can comment on faesibility or point me to tutorials, i'd really appreciate it. I don't want to spend a long time getting partway there just to find out I'm trying to do something that is not possible without being an expert.
 
Last edited:
Why do you need a word document per customer? What are you trying to do? That seems a bit redundant. If you give the purpose, i'm sure there is a better way to consolidate 50 word documents, whatever the purpose is...
 
sorry, i wasn't clear enough. Theer are many hundreds of letters, but usually only 50 for any given customer. At present, employees do not name and save documents with the agreed naming conventions, so it makes documents more difficult to track.

Ideally, every time anyone in the company creates a new Word document, I would like it to be generated from a database (not directly from Word). This will automaically log all correspondance with any given customer, as well as providing all the other reporting options on the stored data.
The user (our company's empoyees) would use a form in the database to enter or select the customer ref, enter or select the correct code for the type of correspondence, and the code attached to a button would create a new record in the documents table. A button on the documents form would open and save a new word document with the correct name, so reducing errors.
 
i just read through your post briefly. Would OLE work here? do you know what that is?
 

Users who are viewing this thread

Back
Top Bottom