Solved

access scripts trasfer embeded pdfs

Posted on 2014-09-09
8
126 Views
Last Modified: 2014-09-16
Hi

Can anyone please help me with some script/code where I can read embeded pdf records by structure and map each record to a new folder at record level abd save pdf documents to respective folder.  This is for a tactical fix before this is incorporated into Shared Point.

I need tp remove 500 records to folders and respective attachmnets saved in the folders.
essentially read folder and pdfs, create folders for each record and paste attached documents under corespondng folder
0
Comment
Question by:yasanthax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 85
ID: 40314181
Note sure what you mean by "read embeded pdf records by structure". Do you mean you have embedded PDF documents in an Access form?

Or are you using the new Attachment field to store these items?
0
 

Author Comment

by:yasanthax
ID: 40314479
yes , embeded pdfs in an access form. So wondering if record name can be put into a directory, then the documentsaved under this folder
0
 
LVL 85
ID: 40315274
How did you embed them? If you can locate the actual item name of the item, you can always use the FileCopy command:

FileCopy "source", "Destination"
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:yasanthax
ID: 40316473
Hi

I inherited a database with pdfs that have been uploaded into it. I have now split the database to Frontend and Backend as they need this for multiple users and now trying to de attach the pdfs and put them into outside folders that can be hyperlinked back from the database.
0
 
LVL 85
ID: 40316736
Okay ... but HOW are they embedded? Are they stored in an OLE field, or an Attachment field? You'd have to give us more information before we could help further.
0
 

Author Comment

by:yasanthax
ID: 40317314
It is in a table in access in a field with datatype=attachment. sorry I have not come across theis before
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40317534
Okay ... so you've got one of the new Attachment fields, and you need to dump the contents to disc.

Here's some code based on http://msdn.microsoft.com/en-us/library/office/ff835669(v=office.15).aspx:

Dim db as DAO.Database
Set db = CurrentDB

Dim rst As DAO.Recordset
Set rst = db.OpenRecordset("SELECT * FROM SomeTable")
  
   … Code to move to desired employee 
Dim rsAttach As DAO.Recordset
rsAttach = rst.Fields("YourAttachmentField").Value

Do Until rsAttach.EOF
  rsAttach.Fields("FileData").SaveToFile "C:\SomeFolder"
  rsAttach.MoveNext
Loop

Open in new window

Note you'd need to change Table and Field names EXCEPT for the "FileData" field in the rsAttach recordset. That FieldName should stay the same ....
0
 

Author Closing Comment

by:yasanthax
ID: 40325575
thanks this works.  One note need to "set rsAttach"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question