11-03-2004, 10:58 AM
Just so you all know I'm a n00b to programing :huh:
My application has a FileListBox that list files from folders in any given directory. I would like to be able to select any of these files and add them as attachments to a new Outlook email message. How would I go about doing this?
11-03-2004, 02:21 PM
This might not be the most appropriate project for a beginner... Office automation with .Net isn't always a very smooth process.
I would start by reading the FAQ thread at the top of this forum, as well as the tutorial that it links to, to learn the general principles of working with Office apps.
Then take a look at MSDN KB 819398 (http://support.microsoft.com/?kbid=819398) that shows the basics of automating Outlook in C# .Net, and MSDN KB 220595 (http://support.microsoft.com/default.aspx?scid=kb;en-us;220595) that has an example of Outlook automation for VB6. Those two also link to other related KB articles.
Next, get comfortable with key parts of the Outlook object model (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaol11/html/oltocOMMap.asp). The Application, NameSpace, MAPIFolder and MailItem (Item) objects will be essential, as MS's code samples show.
That should be enough to get you started, I would think.
Searching this site will also bring up useful examples. Note that most of these are likely to be for VB6 or VBA, but they will still show you what objects, methods and properties you'll need to use.