Can I make C# start Outlook in the code?
In VB6 we use object 'Outlook.Application' and write:'
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNamespace("MAPI")
Set oInbox = oNameSpace.Folders(1)
'Set oInbox = oInbox.Folders("Inbox")
oInbox.Display
'oOutlook.Quit 'Close All Outlook copies
Copy/Paste from link: http://www.ozgrid.com/forum/showthread.php?t=73886
System.Diagnostics.Process
will only start a process.
To do additional actions such choosing folders, you need to use Microsoft Visual Studio Tools for Office (VSTO). And here is it's reference. For example:
var outlook = new Microsoft.Office.Interop.Outlook.ApplicationClass();
outlook.Quit();
If you just want to start the outlook; using System.Diagnostics.Process would be the easiest way. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With