Unable to create Outlook
Hi ,Below is the lines of code which iam using to open outlook while running outof browser application with silver light
it throws a exception "Failed to create an object instance for the specified ProgID" please suggest
dynamic outLook = null;
bool retval = false;
try
{
outLook = AutomationFactory.GetObject("Outlook.Application");
if (outLook != null)
{
retval = true;
}
}
catch (System.Exception ex)
{
}
if (!retval)
{
try
{
outLook = AutomationFactory.CreateObject("Outlook.Application");
}
catch (System.Exception ex)
{
TSDialog.alert(ex.Message, TelStrat.Assets.Resource.MessageInfoAccessOutlook);
}
}
if (outLook != null)
{
var olMail = outLook.CreateItem(0);
olMail.Attachments.Add(EmailPath);
olMail.Display();
olMail.Save();
}