A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Need to suppress Outlook message on msg.Send()



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 3rd 08, 04:08 PM posted to microsoft.public.outlook.program_addins
Adi[_2_]
external usenet poster
 
Posts: 6
Default Need to suppress Outlook message on msg.Send()

Hi,

I am trying to send a meeting programmatically using following code:

try
{
// Create the Outlook application.
Outlook.Application oApp = new Outlook.Application();

// Get the NameSpace and Logon information.
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");

// Log on by using a dialog box to choose the profile.
oNS.Logon(Type.Missing, Type.Missing, true, true);

// Create a new appointment item.
Outlook.AppointmentItem oMsg =
(Outlook.AppointmentItem)oApp.CreateItem(Outlook.O lItemType.olAppointmentItem);

// Set the subject.
oMsg.Subject = "Send Using OOM in C#";

// Add a recipient.
Outlook.Recipients oRecips = (Outlook.Recipients)oMsg.Recipients;
Outlook.Recipient oRecip =
(Outlook.Recipient)oRecips.Add("someone@somewhere. com");
oRecip.Resolve();

// Send.
oMsg.Send();

// Log off.
oNS.Logoff();

// Clean up.
oRecip = null;
oRecips = null;
oMsg = null;
oNS = null;
oApp = null;
}
// Simple error handling.
catch (Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex);
}

When the "oMsg.Send()" is called, Outlook pops open a dialog box with
the following message:
"A program is trying to automatically send e-mail on your behalf. Do
you allow this?..."

Since our requirement is to send meeting automatically behind the
scene, we do not want to have this dialog box pop-up everytime we send
a meeting request.

Is there a way to bypass this message box?

Your help would really be appreciated. Thanks a lot.

Thanks,
Aditya
Ads
  #2  
Old July 3rd 08, 05:00 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Need to suppress Outlook message on msg.Send()

See http://www.outlookcode.com/article.aspx?id=52 for your various options.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Adi" wrote in message
...
Hi,

I am trying to send a meeting programmatically using following code:

try
{
// Create the Outlook application.
Outlook.Application oApp = new Outlook.Application();

// Get the NameSpace and Logon information.
Outlook.NameSpace oNS = oApp.GetNamespace("mapi");

// Log on by using a dialog box to choose the profile.
oNS.Logon(Type.Missing, Type.Missing, true, true);

// Create a new appointment item.
Outlook.AppointmentItem oMsg =
(Outlook.AppointmentItem)oApp.CreateItem(Outlook.O lItemType.olAppointmentItem);

// Set the subject.
oMsg.Subject = "Send Using OOM in C#";

// Add a recipient.
Outlook.Recipients oRecips = (Outlook.Recipients)oMsg.Recipients;
Outlook.Recipient oRecip =
(Outlook.Recipient)oRecips.Add("someone@somewhere. com");
oRecip.Resolve();

// Send.
oMsg.Send();

// Log off.
oNS.Logoff();

// Clean up.
oRecip = null;
oRecips = null;
oMsg = null;
oNS = null;
oApp = null;
}
// Simple error handling.
catch (Exception ex)
{
Console.WriteLine("{0} Exception caught.", ex);
}

When the "oMsg.Send()" is called, Outlook pops open a dialog box with
the following message:
"A program is trying to automatically send e-mail on your behalf. Do
you allow this?..."

Since our requirement is to send meeting automatically behind the
scene, we do not want to have this dialog box pop-up everytime we send
a meeting request.

Is there a way to bypass this message box?

Your help would really be appreciated. Thanks a lot.

Thanks,
Aditya


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to suppress security warning? (Outlook 2002 ATL VC++ addin) furrbie Add-ins for Outlook 1 October 10th 07 03:44 PM
Outlook 2003 - Suppress ‘Overdue’ Appointment Reminders? Agent_C Outlook - General Queries 2 August 23rd 06 01:30 PM
How do I suppress Outlook warning? Matthew Speed Outlook and VBA 5 July 17th 06 04:43 PM
Outlook should have a way to suppress the US (+1) Country Code. Detailer Outlook - Using Contacts 3 April 26th 06 04:55 AM
How to suppress Outlook 2000 SP3 warning Steven Wong Outlook - General Queries 3 March 31st 06 03:28 PM


All times are GMT +1. The time now is 11:48 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.