Perform file/folder operations from access
Posted on 2006-11-01
We have a database that keeps track of all of the projects that we have worked on and the details regarding those jobs. Recently we have had an increase in the number of associated files with the porjects and the upkeep of the files (outside of the database) has become cumbersome. We are looking at a solution of automatically generating some of the necessary files for a project and putting them into a specific folder. Other times there will already be the associated files made and we just want to create a copy inside the project folder.
As an example:
Project A has: a word doc, 3 pictures, and 2 excel files.
The word doc already exists in a folder called: "Opening letters"
The 3 pictures already exist in a folder called: "Product Pictures"
the 2 excel need to be generated by the database
The names of the word doc and pictures are standardized and will be:
The excel files will need to be named as they are exported.
What I will need to do is
1) Look to see if the folder “ProjectA” exists, if not then create it
2) Look to see if the opening letter exists, if it does then copy it to the folder “ProjectA”
3) Look to see if any pictures exist, if there are any then I need to find all of them and move them to the folder “ProjectA”
4) Export the 2 access reports as excel files and name them appropriately, saving in the project folder
The folder “ProjectA” will be created on a network drive as follows \\Office\Projects\ProjectA.
I am fairly proficient at VBA, but I do not know the specific functions that I would use to accomplish this. Any code samples would be appreciated.