
C# // Create a MailMessage object. MailMessage msg = new MailMessage(); // Add a header. msg.Headers.Add("MyHeader", "Some value for my own header", false); VB.NET ' Create a MailMessage object. Dim msg As New MailMessage() ' Add a header. msg.Headers.Add("MyHeader", "Some value for my own header", False)
C# // Remove the non-standard headers from the message. msg.Headers.RemoveCustomHeaders(); VB.NET ' Remove the non-standard headers from the message. msg.Headers.RemoveCustomHeaders()
C# // Remove the specified header. msg.Headers.Remove("X-Special-Header"); // Remove the first header. msg.Headers.RemoveAt(0); VB.NET ' Remove the specified header. msg.Headers.Remove("X-Special-Header") ' Remove the first header. msg.Headers.RemoveAt(0)




| using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace WpfApplication1 { public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); } public void Open() { axEDOffice1.OpenFileDialog(); } public void Protect() { if (axEDOffice1.GetCurrentProgID() == "Word.Application") { axEDOffice1.ProtectDoc(2); } } public void Print() { axEDOffice1.PrintPreview(); } public void Close() { axEDOffice1.ExitOfficeApp(); } } } |

| using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace WpfApplication1 { public partial class Window1 : Window { public Window1() { InitializeComponent(); } private void Open_Click(object sender, RoutedEventArgs e) { _host.Open(); } private void Protect_Click(object sender, RoutedEventArgs e) { _host.Protect(); } private void Print_Click(object sender, RoutedEventArgs e) { _host.Print(); } private void Close_Click(object sender, RoutedEventArgs e) { _host.Close(); } } } |

| public void Open() { //axEDOffice1.OpenFileDialog(); axEDOffice1.Open(sPath, "Word.Application"); axEDOffice1.Open(sPath, "Excel.Application"); axEDOffice1.Open(sPath, "PowerPoint.Application"); axEDOffice1.Open(sPath, "Visio.Application"); axEDOffice1.Open(sPath, "MSProject.Application"); } |












