Is it possible to write code without using CAML?
Is it possible to use this code using VSTA? If so, what references do I use?
Thanks
// Retrieve the base64 encoded string of the attached file
string attachedFile =
MainDataSource.CreateNavigator().SelectSingleNode(
"//my:document", NamespaceManager).Value;
// Convert the base64 encoded string into a byte array
InfoPathAttachmentDecoder decoder =
new InfoPathAttachmentDecoder(attachedFile);
byte[] attachment = decoder.DecodedAttachment;
string fileName = decoder.Filename;
// Add the file as an attachment to the SharePoint list item
item.Attachments.Add(fileName, attachment);