473,385 Members | 1,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Outlook/Mapi Object, Help saving attachments using VB.NET Forms

I found this code and it works great. Is there any way to up date the
code to export attachments to (c:\Exports)?

================================================== =
Dim olFolderCalendar As Integer = 9
Dim olfFolderConflicts As Integer = 19
Dim olFolderContacts As Integer = 10
Dim olFolderDeletedItems As Integer = 3
Dim olFolderDrafts As Integer = 16
Dim olFolderInbox As Integer = 6
Dim olFolderJournal As Integer = 11
Dim olFolderJunk As Integer = 23
Dim olFolderLocalFailures As Integer = 21
Dim olFolderNotes As Integer = 12
Dim olFolderOutbox As Integer = 4
Dim olFolderSentMail As Integer = 5
Dim olFolderServerFailures As Integer = 22
Dim olFolderSyncIssues As Integer = 20
Dim olFolderTasks As Integer = 13
Dim olPublicFoldersAllPublicFolders = 18

Dim oApp As Object = CreateObject("Outlook.Application")
Dim oOutlook As Object = CreateObject("Outlook.Application")
Dim oFolder As Object =
oApp.GetNamespace("MAPI").GetDefaultFolder(olFolde rInbox)
'oFolder = oFolder.Folders("Some Sub Folder")

Dim objMail As Object
Dim FileName As String
Dim i As Integer

For i = 1 To oFolder.Items.Count
objMail = oFolder.Items(i)
Debug.WriteLine(objMail.Subject)
Next i
Nov 20 '05 #1
1 4258
Peter,
The following site has a plethora of articles on using Outlook from .NET.

http://www.microeye.com/resources/res_outlookvsnet.htm

This site, although not necessarily .NET both of these have a lot of Outlook
programming examples & information:

http://www.outlookcode.com/
http://www.slipstick.com/dev/index.htm

The http://www.outlookcode.com/ site would be a good resource for general
Outlook programming questions such as this one.

Hope this helps
Jay
"Peter" <pe***@mclinn.com> wrote in message
news:dc**************************@posting.google.c om...
I found this code and it works great. Is there any way to up date the
code to export attachments to (c:\Exports)?

================================================== =
Dim olFolderCalendar As Integer = 9
Dim olfFolderConflicts As Integer = 19
Dim olFolderContacts As Integer = 10
Dim olFolderDeletedItems As Integer = 3
Dim olFolderDrafts As Integer = 16
Dim olFolderInbox As Integer = 6
Dim olFolderJournal As Integer = 11
Dim olFolderJunk As Integer = 23
Dim olFolderLocalFailures As Integer = 21
Dim olFolderNotes As Integer = 12
Dim olFolderOutbox As Integer = 4
Dim olFolderSentMail As Integer = 5
Dim olFolderServerFailures As Integer = 22
Dim olFolderSyncIssues As Integer = 20
Dim olFolderTasks As Integer = 13
Dim olPublicFoldersAllPublicFolders = 18

Dim oApp As Object = CreateObject("Outlook.Application")
Dim oOutlook As Object = CreateObject("Outlook.Application")
Dim oFolder As Object =
oApp.GetNamespace("MAPI").GetDefaultFolder(olFolde rInbox)
'oFolder = oFolder.Folders("Some Sub Folder")

Dim objMail As Object
Dim FileName As String
Dim i As Integer

For i = 1 To oFolder.Items.Count
objMail = oFolder.Items(i)
Debug.WriteLine(objMail.Subject)
Next i

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Job Lot | last post by:
I am retrieving message from the Inbox as follows: (MS Article ID 310258: How to use the Microsoft Outlook Object Library to retrieve a message from the Inbox by using Visual C# .NET) Try Dim...
5
by: Siv | last post by:
Hi, A little while ago I asked if anyone could help me with how to create an email using MS Outlook that contained an embedded picture file. Thanks to Jay Harlow I was able to get this working...
2
by: Pieter | last post by:
Hi, I'm using a thight integration with Outlook 2003 (with an Exchange server) in my VB.NET (2005) application. Until now I'm using the Outlook Object Model, but it appears to be very slow, and...
3
by: Vipin Kumar | last post by:
Hi All, I want to store all the attachment's name from outlook express to the sql server database table using C#. Is there a way around to do this. Should i use the .psi files for that. How...
6
by: c_shah | last post by:
how to save outlook email attachments using VB.net?
3
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and...
7
by: Dean Spencer | last post by:
Can anyone help? I am importing Emails from Outlook using the following code: Public Function ScanInbox(SubjectLine As String) Dim TempRst As Recordset Dim OlApp As Outlook.Application Dim...
4
prabunewindia
by: prabunewindia | last post by:
Hello everybody, here i am going to explain, how to get mails from Outlook express database and store in our own database(local) Initially you have to add the refference Outlook library10.0 or...
0
by: printline | last post by:
Hello I have the following macro for outlook: Dim oApp As Application Dim oNS As NameSpace Dim oMsg As Object Dim bDoAction As Boolean Dim oAttachments As Outlook.Attachments
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.