Entrepreneurship has been on the rise in sunny Singapore over the past years with more and more youths having the guts to take the bold step to be different - stepping out of the comforts of a stable 9am to 5pm desk job to realize their dreams. Although I'm still fairly un-impressed with our startup scene here (in comparison with the US, or something closer to home - China and Korea), I am happy to say that things are going better and instead of complaining, many Singaporeans are taking the step to improve things at home after returning from the valley.Wong Meng Meng and Sim Wong Hu who decided to call Singapore home despite their success overseas. Come June 2013, GushCloud will be hosting the world's largest Hackathon in Singapore at the Amazon HQ Singapore.
Basically if you've not already heard about it, a hackathon is an event where like minded people come together to "hack together" something and make it work in a very short period of time. The objectives of such sessions is not to produce something that you can readily sell to people, but rather a working proof-of-concept of an idea, that allows others to visualize and actually test the idea using a working model.
People who attends such sessions includes veterans as well as newbies, who attends hackathons mainly for learning, meeting new people and hoping to do their parts to change the world.Read the entire post via http://www.darrensim.com/2013/05/14/worlds-largest-startup-competition-and-hackathon-angelhack-2013-comes-to-singapore-in-june-2013/
I've been working with a government agency lately, and came to notice that the software system they're using dates back to the stone ages. Many a time, the head of department is required to send an email to other head of departments within the same organization, each with a similar content, yet with attachment of nominal roll of folks under each of the departments (PS: HR Stuff).
On every occasion that I observe, this poor balding guy has to create a template in outlook and copy it 20 times, adding the list of recipients to the individual MSG file and attaching the relevant set of excel/word document file for each of these departments.
Of course, as a software engineer, the first thing on the mind is definitely, "AUTOMATION"!
Microsoft Office Outlook does have an interop dll which specifically allows for this to be done, easily! Another altanative would definitely be making use of Visual Studio Tools for Office (VSTO).
To save you the trouble of looking for this DLL, i've attached a copy to this blogpost.
1. To begin, let's first create a C# Winforms Project in Visual Studio.
2. Next, let's add the reference to the interop DLL (attached on this blog post). You should see something like the following.
3. For the purpose of this tutorial, we'd create a simple windows form which takes in the mail receipient, subject, message and attachment fields. Once you're familiar with how the code (which we'd discuss later), you can work more magic around this (e.g. creating automation processes)
Note: The Importance ComboBox should have the following values "High","Normal" and 'Low".
4. Next step, is to wire up the code-behind for the Save Button. It's optional whether you want to register the Outlook Interop in the namespace or not. In this example, I do not so so, thus qualifying the full path in the code (below).// Creates a new Outlook Application Instance
Outlook.Application objOutlook = new Outlook.Application();
// Creating a new Outlook Message from the Outlook Application Instance// Assigns the "TO", "CC" and "BCC" Fields
Outlook.MailItem mic = (Outlook.MailItem)(objOutlook.CreateItem(Outlook.OlItemType.olMailItem));
mic.To = toTextBox.Text;
mic.CC = ccTextBox.Text;
mic.BCC = bccTextBox.Text;
// Assigns the Subject Fieldmic.Subject = subjectTextBox.Text;// Switch the Importance ComboBox to identify the Mail Message Importance Level
mic.Importance = Outlook.OlImportance.olImportanceHigh;
break; case "Normal":
mic.Importance = Outlook.OlImportance.olImportanceNormal;
break; case "Low":
mic.Importance = Outlook.OlImportance.olImportanceLow;
// Define the Mail Message Body. In this example, you can add in HTML content to the mail message bodymic.HTMLBody = messageTextBox.Text;
// Adds Attachment to the Mail Message.mic.Attachments.Add(attachmentOneTextBox.Text,Outlook.OlAttachmentType.olByValue,1,"Attachment Name");
// Note: You could add more than one attachment to the mail message.
// All you need to do is to declare this relative to the number of attachments you have.
// Save the message to C:\demo.msg. Alternatively you can create a SaveFileDialog tomic.SaveAs(@"C:\demo.msg", Outlook.OlSaveAsType.olMSG);
// allow users to choose where to save the file
Easy isn't it? Besides creating mail messages, you can also create other outlook items such as task, calendar objects and more. More to come in the future posts. Do let me know your comments/views on this post.
Tutorial in PDF Format (http://darrensim.com/files/folders/presentations/entry9679.aspx)