creanova2000
Messages postés39Date d'inscriptionjeudi 31 juillet 2003StatutMembreDernière intervention21 septembre 2006
-
28 janv. 2005 à 19:23
cs_sarv
Messages postés2Date d'inscriptionjeudi 23 janvier 2003StatutMembreDernière intervention29 mars 2006
-
29 mars 2006 à 14:40
Bonjour,
J'utilise le code suivant pour envoyer un email a deux distinataires. En utilisant Outlook 2003
Le probleme c'est quand le programme envoi les email Outlook jette un mesage de securite.
J'ai mis le niveau de securite de Outlook au niveua le plus bas, mais cela ne resoud pas le probleme.
Comment faire Pour se debarasser de ce message de securite et de confirmation que outlook 2003 donne ?
Voici le code :
using System;
//TO DO: If you use the Microsoft Outlook 11.0 Object Library, uncomment the following line.
using Outlook = Microsoft.Office.Interop.Outlook;
namespace outlooktest
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static
void Main(
string[] args)
{
//
// TODO: Add code to start application here
//
try
{
// Create the Outlook application by using inline initialization.
Outlook.Application oApp =
new Outlook.Application();
//Create the new message by using the simplest approach.
creanova2000
Messages postés39Date d'inscriptionjeudi 31 juillet 2003StatutMembreDernière intervention21 septembre 20065 1 févr. 2005 à 18:12
Bonjour,
Merci d'avoir repondu a mon message.
Je suis alle au lien que vous m'avez donne. Franchement j'ai pas compris grand chose puisque je suis novice dans c#.
Ce que j'ai compris que le message de securite n'existe pas dans la version Outlook 2000.
Donc j'ai choisi d'utilise ce dernier, mais a l'execution de mon code je recois l'erreur qui dit "failed to query Outlook._Application..." Pourtant j'ai ajouter les references de l'objet Outlook et Office a mes reference.
Comment resoudre ce Probleme ?
Voici le code que j'ai utilise et dit moi ce qui manque et ou je dois l'ajouter
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
namespace emailtest1
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btn1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.btn1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btn1
//
this.btn1.Location = new System.Drawing.Point(104, 192);
this.btn1.Name = "btn1";
this.btn1.TabIndex = 0;
this.btn1.Text = "button1";
this.btn1.Click += new System.EventHandler(this.btn1_Click);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.btn1});
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}