Notifications
Announcements
No record found.
How to read text/string value from docx email-activity attachment without downloading the file in dynamics crm.
*This post is locked for comments
Refer this:
parthimscrm.wordpress.com/.../read-annotation-file-contents-crm-2011-c
msdn.microsoft.com/.../gg328429.aspx
thanks for reply,
it doesnt work.
In my requirement i have to read the text/string value directly from the encoded document without downloading or saving the file.
Thanks for sharing the reference, Mohd.
Hi
It looks like it is working, as you can see the content displayed.
string fileName = (string)annotationFRI.Attributes["filename"]; string noteText = (string)annotationFRI.Attributes["notetext"]; string documentBody = (string)annotationFRI.Attributes["documentbody"]; byte[] fileContent = Convert.FromBase64String(documentBody);
My .doc file attachment get encode in my 'activityattachment' . so using c# i can get the 'body' value .but using that value i cant get the text/string directly.
i tired using,
var encode= ent.Attributes["body"].ToString(); byte[] byt = Convert.FromBase64String(encode); string decodedString = Encoding.UTF8.GetString(byt);
in "decodedstring" i am getting the some junk values(pic in above post).
Hello,
Check this article, it should help you to find an answer - http://lmgtfy.com/?s=b&iie=1&q=read+docx+file+in+c%23
This probably aren't 'junk values' - this is the body of the document. Word documents need to be parsed by software that understands the document format, i.e. Microsoft Word
thanks for the reply,
That my problem without saving or creating a word document using that value, how to get the the string values present in the encoded files?Is there any way to get the string value ?
so my scenario is like when i get a email attachment,i need to read text values from the attachment(using docx & excel types)
We can tell you how to use CRM SDK to correctly extract the contents of that attachment, but not necessarily how to parse a word document in your code. This might be a question you can get answered faster at stackoverflow (or C# forums)
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2