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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing the path of a Word document in Access automatically

Status
Not open for further replies.

timnicholls

Technical User
Oct 31, 2003
43
AU
Hi,

I have been working on this for a while and need further input.

I have a merge for an individual document going out to Word via code.

All is working well.

I am having trouble saving the documents path automatically and updating a subform field with the path with each new document for each seperate client.

Non technically, I wish to have a subform that is a document management area for each client.
I wish to save a document/s for a client so I can get back and open it again months/years later.

So on a main form you can select from 10 Word documents in a combobox. The same 10 docs. are available for every client.

One is selected and is opened and merged with all the correct details. On saving/closing, the path of that Word document is allocated to the subform and a title is created so you can always go to that client on the main form and see how many documents they have and you can open it agian and modify it etc.

There are 200 clients (and climbing) and one client may have 50 docs. associated and one may have none.

I do not know how to update the recordset for a new record and place the path
in the proper place. I have it set up to do it manually, you press a button to
open a dialog and find the document after you have saved it to a common folder,
but I would like to automatically save the document and the path at the same time.
(When the document closes)

I think I should be using Application.ActiveDocument.Close to do something after Word closes then Application.ActiveDocument.FullName to get the path of where the document was saved...

To help everybody I have a working demo at
(160K)

All the important code is behind the cmdWord Button I think.

Can I ask a couple of people to have a look?
A couple of demo templates are also included so everything works as it should (so far anyway)

Thanks
Tim
 
Have you considered to save the document automatically and not allow the user to enter the file name?

Pre-established file path example: "\\servername\clientID (or Client Name)\2004\" & templatename & now() & ".doc", where templatename is based on the 5 pre-established templates.

You will of course have to make sure the file and path exist prior to saving to this location and then create paths as necessary.

Your working demo is great!

SATHandle
[thumbsup]

Don't beat your head against the wall unless you know how to plaster.
 
SATHandle,

There has to be a way of the user giving a title they can understand/look for to each document so the title part can stay.

But interestingly the filename is generated automatically. It can be changed by the user though as they see fit using Save As and this has to be kept as a feature.

<sigh>

Thanks
Tim



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top