Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Opening Outlook with attachment

Thread Tools

Opening Outlook with attachment

Posts: n/a
Hi all,
I am trying to open outlook express along with an attachment.
I have added a reference to the Microsoft outlook Library
I am using the following lines of code.
Outlook.Application OutApp = new Outlook.Application();
Outlook.OlItemType olItem = new Outlook.OlItemType();
Outlook.MailItem OutMail = (Outlook.MailItem)OutApp.CreateItem(olItem);
OutMail.To = ToAddress;
//OutMail.SenderName = FromAddress;
OutMail.Subject= Subject;
OutMail.Body = Body;

While compiling it doesnt give any error. However when I run the code it fails at the first line where I am trying to create an object of Outlook Application type
The error says " Acess is denied"

When I try to open outlook using mailto: it opens fine, but I am not able to attach a file to it at the runtime.
Any help on this will be highly appreciated.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone resolved links opening blank page? or box opening in Outlook 2000? S.Rodgers Firefox 13 12-16-2005 03:07 PM
Outlook Error when opening Calender or Outlook Today =?Utf-8?B?c2FuZHdvcm0=?= MCSE 3 10-12-2005 05:38 PM
Outlook Express Attachment Opening Error Computer Support 2 01-22-2005 05:38 PM
please help with attachment opening Josie Computer Support 3 01-22-2005 01:04 AM
Opening attachment Don Jennings Computer Support 15 11-07-2003 05:46 PM