attaching a file to a sharepoint record

E

Eric

what is the best way to do this using VBA inside access 2007? The sharepoint
record "tickets" is linked. I've tried the loadtofile function with the
following code and get "invalid argument" at that line.

'Save files to sharepoint
Set rst = db.OpenRecordset("Tickets")
Do Until rst.EOF
If rst!TicketNr = newWO Then
Set rst1 = rst.Fields("Attachments").Value
Y = 1
Do Until Y = z - 1
strFile = "C:\" & Files(Y)
rst.Edit
rst1.AddNew
rst1.Fields("FileData").LoadFromFile strFile
rst1.Update
rst.Update
Y = Y + 1
Loop
rst1.Close
End If
rst.MoveNext
Loop
rst.Close
 
D

Dale Fye

I've never worked with the Attachments field in Sharepoint, but the first
question that comes to mind is:

Where does the value of Z come from in:

Do Until Y = z - 1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top