I currently have a table ("Transfer Table") with records containing a numeric primary key and an attachments field. There are multiple files in the attachment field stored.
i've been having difficulty trying to adapt microsoft's VBA code example and other people's coding to do the following
For each attachment, save it into directory with the name of the primary key within a static directory (i.e. "C:\Users\" & User & "\Desktop\New Folder").
For example, if the first record had a primary key of 5 and had files A.jpeg, B.jpeg and C.jpeg. The files would be saved and appear like this:
The next record would have a primary key of 23 and has files D.jpeg, E.jpeg, F.jpeg, Z.jpeg. The files would be saved and appear like this:
the VBA code would have to go through each record in turn and save all the attachments to their corresponding primary key directories.
Please help.
i've been having difficulty trying to adapt microsoft's VBA code example and other people's coding to do the following
For each attachment, save it into directory with the name of the primary key within a static directory (i.e. "C:\Users\" & User & "\Desktop\New Folder").
For example, if the first record had a primary key of 5 and had files A.jpeg, B.jpeg and C.jpeg. The files would be saved and appear like this:
- C:\Users\JoeBloggs\Desktop\New Folder\5\A.jpeg
- C:\Users\JoeBloggs\Desktop\New Folder\5\B.jpeg
- C:\Users\JoeBloggs\Desktop\New Folder\5\C.jpeg
The next record would have a primary key of 23 and has files D.jpeg, E.jpeg, F.jpeg, Z.jpeg. The files would be saved and appear like this:
- C:\Users\JoeBloggs\Desktop\New Folder\23\D.jpeg
- C:\Users\JoeBloggs\Desktop\New Folder\23\E.jpeg
- C:\Users\JoeBloggs\Desktop\New Folder\23\F.jpeg
- C:\Users\JoeBloggs\Desktop\New Folder\23\Z.jpeg
the VBA code would have to go through each record in turn and save all the attachments to their corresponding primary key directories.
Please help.
Last edited: