QueryExpression noteQuery = newQueryExpression
{
EntityName = "annotation",
ColumnSet = newColumnSet(true),
Criteria = newFilterExpression
{
Conditions =
{
newConditionExpression
{
AttributeName = "objectid",
Operator = ConditionOperator.Equal,
Values = { "92F7CEA6-7D7A-E611-81AC-001DD8B84ED2" }
},
}
}
};
EntityCollection notesCollection = service.RetrieveMultiple(noteQuery);
if (notesCollection.Entities.Count > 0)
{
foreach (Entity note in notesCollection.Entities)
{
if (note.Attributes.Contains("annotationid"))
{
Guid noteId = (Guid)note["annotationid"];
}
if (note.Attributes.Contains("filename"))
{
String fileName = note["filename"].ToString();
}
if (note.Attributes.Contains("documentbody"))
{
String file = note["documentbody"].ToString();
Console.WriteLine(file);
}
}
}
I am getting documentbody as a base64 string how do I convert that to Plain text
byte[] theData = Convert.FromBase64String(file);
string content = System.Text.Encoding.UTF8.GetString(file);
this will not work as Attachement is wordDoc.