?
Solved

access scripts trasfer embeded pdfs

Posted on 2014-09-09
8
Medium Priority
?
127 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

770 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