How to avoid Outlook security alert when sending outlook appointment from C# program
<p><br/>
I wrote a function in order to send appointment via microsoft outlook. The method works but before sending the appointment, Outlook security alert pops out and ask if I allow/deny access.
<br/>this is my code:</p>

<pre class="lang-cs prettyprint-override"><code>public static void SendAppointment()
    {            
        Outlook.Application oApp = new Outlook.Application();            
        Outlook.AppointmentItem oAppointment = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem);

        oAppointment.Subject = "subject";
        oAppointment.Body = "Body";
        oAppointment.Location = "some location";
        oAppointment.Start = DateTime.Now;
        oAppointment.End = DateTime.Now.AddDays(1);
        oAppointment.Importance = Outlook.OlImportance.olImportanceNormal;            
        oAppointment.MeetingStatus = Outlook.OlMeetingStatus.olMeeting;

        Outlook.Recipient oRecip = oAppointment.Recipients.Add("sample@gmail.com");
        oRecip.Resolve(); // Not sure if this line is necessary

        oAppointment.Send();
    }
</code></pre>

<p>I saw somewhere that to fix it not to build new application but to get an existing using this line:<br/>
</p>

<pre><code>Outlook.MailItem tempItem = Globals.ThisAddIn.Application.CreateItem(Outlook.OlItemType.olMailItem);
</code></pre>

<p>But I could not found assembly where the Globals class is.</p>
