How to add a new item to a sharepoint list using VBA?

42 Views Asked by At

I add a new recordset to a sharepoint list using ADOBD as shown in the code snipped below.

It does work for the column "Title" but the column "Description" keeps empty on sharepoint. The coulmn "Title" is plain text and the column "Description" is set to be enhance rich text on sharepoint. Could this be the reason?

Why does it not add text to the column "Description"?

Public Sub UploadToSharePointList()

[...]

With Rec_Set
.ActiveConnection = Conn
.CursorType = adOpenDynamic ' adOpenStatic,
.CursorLocation = adUseClient
.LockType = adLockOptimistic ' adLockPessimistic
.Source = Sql
.Open

.AddNew
    .Fields("Title").Value = "Test Title 2"
    .Fields("Description").Value = "Test Description" 'This column keeps empty
.Update

End With
[...]

End Sub
0

There are 0 best solutions below