I have the below code to create email and folders based on data from the database. For now, I'm able to create the main folder and add a word document inside. What could be changed on the code or added to add 2 sub folder named "Documents" and "Correspondence"
Greetings.
Code:
Option Compare Database
Private Sub SendEmail_Click()
On Error GoTo Err_open_word_Click
I am trying to set up something to be able to take me to a folder that holds various forms for personnel. I have a query that generates the link for each person. I have tried to set it up as a hyperlink in ACCESS 2013 and it displays as one but doesn't act like one.
I want to be able to click the link and have it open up a personnel folder for that individual. I can't find a MACRO that I can create to do it. Example of my query is that it creates a link K:Main BreakdownSection BreakdownPersonnel FoldersName and the name is the variable part.
My next problem will be to have it create that folder when we have new personnel arriving.
I would also note that I have not worked with ACCESS in many years and much of what I was able to do with 2002 and 2003 doesn't work with the newer versions of ACCESS.
I'm trying to open a folder based on a BIN nr. This folder could be in a main folder that has diferent subfolder. As there where differnt naming used to create the folderes, one of the things they have always is the BIN nr. It alwasy start with a unique number and maybe I could use it to scan the subfolders and open that one that the BIN nr is equal as in the field BIN.
Now we have serveral 1000th of folders and finding them takes time.
I am trying to make some folders from a Query list to my C drive.I found this code for making folders. I have a button on a form with this code. It works with making a folder but only gives me the first item in the query out of many rows. It is missing the rest of the items.Also I would like it to be able to make Sub Folders too from this query.Here is the code I found.
Private Sub MakePreservationTagFolder_DblClick(Cancel As Integer) Dim strFolder As String strFolder = "C:UsersryanDocuments" & "Tag - " & DLookup("[Tag]", "Tags Qy")
the code below sends 3 reports to a folder that the vba creates if needed. I would like to change it so the 3 reports go to different folders and creates a folder with the customer name in each of the below folders if needed at present it looks table with one folder address is as I dont know how to make it look up the 3 different records in that table so I would like to just put the 3 folder address in the code
I have over 500 folders that contain XML files in each folder. I need to go through each folder and append the data from the XML files into my database.
I'm using a function to find all files/folders in a specific directory, then copy each one to a specific destination folder. I'm going to use this on a weekly basis to backup files on a computer. I would like to use the vbarchive in GetAttr/SetAttr so I only need to copy these if they have changed since last backup.
Something like:
If GetAttr(strFile) And vbArchive = 32 then filecopy xxxx, xxxx else rs.movenext
As I understand it, a value of 32 indicates that the file has been modified since it was last backuped up (i.e. since the file attribute was "reset"). How do I "reset" the file attributes to clear the vbArchive?? I've read some google searches and the only thing I could find was the files were set to vbnormal however I'm concerned that this will erase program files that are vbReadOnly or VbHidden.
I have been looking into populating a tree-view with folders and files, and have found some great examples for doing this, How ever...I cannot seem to work out how to show files/pictures in a form based on the click event of the tree-view.
I have managed to do an onclick event for the files in the tree-view, but I cannot seem to get the onclick event for folders in a tree-view.
Here is an example which I am working on at the moment, but get the error Object variable Or with block variable not set.
Code: Private Sub tvw_Click() Dim tClient As String Dim tParent As Scripting.folder Dim fd As Scripting.folder Dim fNode As MSComctlLib.Node
create/find code that will count the number of text files in a directory with one level of folders please see below:
Directory path is : B:
First and only level of sub folders:
there are 100 of these and they all end in ".fof"These .fof folders will always contain .txt files.I've tried using the following code, but it always returns No files found.
Code:
Dim lngFileCount As Long Dim StrFileName As String StrFileName = Dir$("B:*.txt") Do While Len(StrFileName) <> 0
I'm trying to automate a process of selecting a set of file/s and move them in a folder. When I click on a button, it should open a current folder that is setup in the code.
Lets say that I have a folder C:documents est, and very time I click on the button, it should open the dialog box with that path so I can select the files from another folder, drag them there and they will be saved in that folder.
This will form part of wider automation that will send an email stating that those file/s where placed in that folder.
I have in the same form where the button is placed, 3 check boxes that needs to be passed to the email as well that one or all the files where placed in the folder.
I am currently using this path, but I moved my database folder into another folder so people won't mess with it. I still need to create files to the original directory. How can I make the FilePath still relative but up one folder from CurrentProject.path?
I'm trying to write a simple little database. At one point on a form, I'm trying to merge all the pdf files in a particular folder. (I'm using the pdftke.exe program and there will be multiple pdf files)
It all works perfectly if I call it as below, with the actual paths already hard coded. It combines all the pdf files and renames it to the "merged filename.pdf" correctly
Dim stAppName1 As String stAppName1 = "C:a folder namepdftk.exe C:another folder nameprints*.pdf cat output C:folder where merged file will bemerged filename.pdf" Call Shell(stAppName1, 1)
However, I'm trying to have it work with the middle portion (the folder where all the pdf files are) being created on the fly so to speak.
The middle portion/path I have stored from a previous form and it's stored in a table.
So I'm trying the below, but doesn't seem to work.
Dim stAppName1 As String Dim combine_files As String combine_files = (this pulls a path from a stored field on the open form) + "" + CStr("*.pdf")
stAppName1 = "C:a folder namepdftk.exe (combine_files) cat output C:folder where merged file will bemerged filename.pdf" Call Shell(stAppName1, 1)
With the code above, it doesn't seem to do anything.
I have a form which has a field called quote directory, this contains the path of the quote documents and sub folders, I also have a field called project directory.
When a quote is confirmed I have it all working so a new folder is created with specfic details like project number etc.What I want to do is move the folder from the quote directory and put it in the newly created folder in the project directory.
I added to my database a button to ouput the data to PDF. It works as it should. We do print out the letters in paper and put a copy in the folder from the client (connected with the ID nr). From time to time we need to attach a PDF document to the letter and combine it. My question is now if it is possible to have some code to the button that when it finish the output to PDF it will combine all the PDF files that are in the folder and put it in a second folder. After that, I need to put the combined PDF in another folder.
I used to have a code that we used to copy data from a folder that was on the desktop using the code below.
Code: DoCmd.CopyObject "C:Documents and SettingsAll UsersDesktopWetcleans
This does not work with windows7. I have tried the C:USERSPUBLICDESSKTOPWetcleans but that does not seem to work either. How to access a folder on the desktop ?
I am trying to define a path to identify a current folder - I'll try and explain the way the following code works first (and it does work 100%)
The following code identifies folders and sub-folder structures and imports them (their structures and folder paths and filenames) into a DB
It also simultaneously retrieve's any xml docs within those respective folders and imports the XML data into the same database ........ and then moves those folders into a "processing folder" location.
Cool yes, but I can only import the XML doc's at the moment, by hard coding the path (like this):-
In order to act as a system, I would like to have a function or windows firstly displayed all the folder names in a drive, and then allow user to locate/select freely a folder among different folders. Is there anything for my reference or for me to start??
I'm trying to check a directory for a folder name which has a certain string in it (RecNum)
However the fso object filesys.FolderExists does not take an argument when looking for part of a folder name on a particular path.
What I basically want to do is look in a directory for a folder with the RecNum variable as part of the folder name. if it exists open it, if not create it.
Set filesys = CreateObject("Scripting.FileSystemObject") If filesys.FolderExists(targetdir) Then GoTo function_end MkDir targetdir If filesys.FolderExists(copypath) Then filesys.CopyFolder copypath, targetdir End If MsgBox ("folder created") function_end: