A product that we use is storing the Letter Express (Mail Merge) template as a BLOB (or CLOB...I cannot remember right now). We use the Product's API to call this letter express and send an email.
Now, we want the content of the email to be captured and stored in a separate field. The API provides us with a LetterExpress.WordDocument property which has the template. This is however a byte[]
.
I am trying to get this into a string object so that I can populate the place holders and then store it in a different field.
This is the code that I was trying.
System.Text.Encoding.ASCII.GetString(LetterExpress.WordDocument)
However, I get an error as follows
The best overloaded method match for 'System.Text.Encoding.GetString(byte[])' has some invalid arguments
Why am I getting this error?
How can I ascertain what is the encoding that is being used for the LetterExpress.WordDocument? Or is there a generic method that can convert it into a string?