I have a requirement where a plugin will trigger on recieving an email from a specific email address and will have an attachment i.e. abc.docx
I need to read abc.docx and get all attributes and convert into a case record in CRM
I can get file name and body of the document using following query
QueryExpression _attachmentQuery = new QueryExpression { EntityName = "activitymimeattachment", ColumnSet = new ColumnSet("activitymimeattachmentid","filename", "body"), Criteria = new FilterExpression { Conditions = { new ConditionExpression { AttributeName = "objectid", Operator = ConditionOperator.Equal, Values = { emailid } }, new ConditionExpression { AttributeName = "objecttypecode", Operator = ConditionOperator.Equal, Values = {"email"} } } } }; EntityCollection results = service.RetrieveMultiple( _attachmentQuery); return results;
However when I am unable to pass this step as when I try to convert this to stream and/or use in WordprocessingDocument I get exception Null
Any idea if it is possible in CRM online?
I have merged 'DocumentFormat.OpenXml' suing ILmerge but still no luck
Any help appreciated.
Thanks
*This post is locked for comments