Monday, June 22, 2009

Read word document proprties

string filePath = "c:\\docprop.doc";
object file = filePath;
object nullobj = System.Reflection.Missing.Value;
Word.Document oDoc = oWord.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);

oDocBuiltInProps = oDoc.BuiltInDocumentProperties;

Optical Character Recongnition

Excellent article on OCR (optical character recongnition application using artificial neural networks)

http://www.codeproject.com/KB/recipes/UnicodeOCR.aspx

C# Send mail - Windows application

Outlook.Application oApp = new Outlook.Application();

//Create the new message by using the simplest approach.
Outlook.MailItem oMsg= Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);

//Add a recipient
Outlook.Recipient oRecip;
oRecip = (Outlook.Recipient)oMsg.Recipients.Add("xyz@xyz.com");

//Set the basic properties.
oMsg.Subject = "Payment received";
oMsg.Body = "Dear Sir, We have received payment for your order";

//Send the message.
oMsg.Save();
oMsg.Send();

//Explicitly release objects.
oRecip = null;
//oAttach = null;
oMsg = null;
oApp = null;