Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to automate Outlook in C Sharp
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
How to automate Outlook in C Sharp
Miscellaneous
Thread ID:
00977515
Message ID:
00977515
Views:
88
HI.
My question is a specific one, but could answer a more general question also.. how to automate MS Office applications from C Sharp:

I have the folowing working in a VFP app and want to replicate in CSharp:
    loApp=CREATEOBJECT("Outlook.application")
    loSpace=loApp.GetNameSpace('MAPI')
    loMsg = loSpace.GetDefaultFolder(4)
    loNew=loMsg.Items.Add()

    loNew.Recipients.add(lcEmail)
    loNew.SubJect = "MySubject"
    loNew.Body    = "MyBody"

    loNew.Attachments.Add(MyFile)
    loNew.Send
This opens up Outlook and creates an Email ready to be sent in the outbox.

I did a Help for 'Outlook' in Dot Net but could not find any examples .

Any help appreciated.

Gerard
Next
Reply
Map
View

Click here to load this message in the networking platform