question

RichardCruthirds-1707 avatar image
0 Votes"
RichardCruthirds-1707 asked thedbguy answered

Need to convert from embedded documents to linked documents

I made a rookie mistake by embedding documents into a table instead of linking them. . . luckily, the documents are still in the same location that they were embedded from . . .does anyone have any VBA code that will run through the table and either build another table or add a field in the same table with the filename link so I can delete the embedded documents and revert to a link?

office-access-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thedbguy avatar image
0 Votes"
thedbguy answered

Okay, I just did a quick test by adding an Attachment field to a table and then running this code. It printed all the filenames I added to the table.

 Public Function ListAttachments() As Boolean
 'thedbguy@gmail.com
 '9/27/2021
    
 Dim db As DAO.Database
 Dim rs As DAO.Recordset
 Dim rs2 As DAO.Recordset2
    
 Set db = CurrentDb()
 Set rs = db.OpenRecordset("Table1")
    
 With rs
     Do While Not .EOF
         Set rs2 = !docs.Value
         Do While Not rs2.EOF
             Debug.Print rs2.FileName
             rs2.MoveNext
         Loop
         rs2.Close
         .MoveNext
     Loop
     .Close
 End With
    
 Set rs2 = Nothing
 Set rs = Nothing
 Set db = Nothing
    
 End Function

Hope that helps...

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thedbguy avatar image
0 Votes"
thedbguy answered

Hi. How many records/documents are we talking about? Is there too much to do it manually?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardCruthirds-1707 avatar image
0 Votes"
RichardCruthirds-1707 answered

Yes . . .almost 5,000 records

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thedbguy avatar image
0 Votes"
thedbguy answered

Hi. Thanks for the clarification. One more question: Are we talking about an Attachment field or OLE Object?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardCruthirds-1707 avatar image
0 Votes"
RichardCruthirds-1707 answered

It's an Attachment field

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardCruthirds-1707 avatar image
0 Votes"
RichardCruthirds-1707 answered

That should work . . . thanks so much . . .

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

thedbguy avatar image
0 Votes"
thedbguy answered

You're welcome. Let us know how it goes. Good luck!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.