473,802 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 olFolderCalenda r As Integer = 9
Dim olfFolderConfli cts As Integer = 19
Dim olFolderContact s As Integer = 10
Dim olFolderDeleted Items As Integer = 3
Dim olFolderDrafts As Integer = 16
Dim olFolderInbox As Integer = 6
Dim olFolderJournal As Integer = 11
Dim olFolderJunk As Integer = 23
Dim olFolderLocalFa ilures As Integer = 21
Dim olFolderNotes As Integer = 12
Dim olFolderOutbox As Integer = 4
Dim olFolderSentMai l As Integer = 5
Dim olFolderServerF ailures As Integer = 22
Dim olFolderSyncIss ues As Integer = 20
Dim olFolderTasks As Integer = 13
Dim olPublicFolders AllPublicFolder s = 18

Dim oApp As Object = CreateObject("O utlook.Applicat ion")
Dim oOutlook As Object = CreateObject("O utlook.Applicat ion")
Dim oFolder As Object =
oApp.GetNamespa ce("MAPI").GetD efaultFolder(ol FolderInbox)
'oFolder = oFolder.Folders ("Some Sub Folder")

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

For i = 1 To oFolder.Items.C ount
objMail = oFolder.Items(i )
Debug.WriteLine (objMail.Subjec t)
Next i
Nov 20 '05 #1
1 4287
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.c om> wrote in message
news:dc******** *************** ***@posting.goo gle.com...
I found this code and it works great. Is there any way to up date the
code to export attachments to (c:\Exports)?

=============== =============== =============== ======
Dim olFolderCalenda r As Integer = 9
Dim olfFolderConfli cts As Integer = 19
Dim olFolderContact s As Integer = 10
Dim olFolderDeleted Items As Integer = 3
Dim olFolderDrafts As Integer = 16
Dim olFolderInbox As Integer = 6
Dim olFolderJournal As Integer = 11
Dim olFolderJunk As Integer = 23
Dim olFolderLocalFa ilures As Integer = 21
Dim olFolderNotes As Integer = 12
Dim olFolderOutbox As Integer = 4
Dim olFolderSentMai l As Integer = 5
Dim olFolderServerF ailures As Integer = 22
Dim olFolderSyncIss ues As Integer = 20
Dim olFolderTasks As Integer = 13
Dim olPublicFolders AllPublicFolder s = 18

Dim oApp As Object = CreateObject("O utlook.Applicat ion")
Dim oOutlook As Object = CreateObject("O utlook.Applicat ion")
Dim oFolder As Object =
oApp.GetNamespa ce("MAPI").GetD efaultFolder(ol FolderInbox)
'oFolder = oFolder.Folders ("Some Sub Folder")

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

For i = 1 To oFolder.Items.C ount
objMail = oFolder.Items(i )
Debug.WriteLine (objMail.Subjec t)
Next i

Nov 20 '05 #2

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

Similar topics

0
5428
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 oApp As Outlook.Application = New Outlook.Application Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi") oNS.Logon(Missing.Value, Missing.Value, False, True) Dim oInbox As Outlook.MAPIFolder =...
5
3931
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 using a code example from http://www.outlookcode.com/d/code/htmlimg.htm that details the procedure and with a bit of tweaking I managed to get it working really well. I now find that there is a new user on a laptop that always gets an error at...
2
2451
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 has some problems: - doing a Move changes the ReceivedTime of the MailItem - I can't use RichText in the MailItem.Body (only allows plain text or HTML) - some other stuff like having to use small 'tricks' to show the default signature in an email
3
2664
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 could i do it. Could anyone give me a hint, so that i can go to the way. Thanks in advance. Vipin Kumar
6
10506
by: c_shah | last post by:
how to save outlook email attachments using VB.net?
3
2861
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 additionally pictures of the product are stored in an images subfolder and the database holds the file name of the relevant picture. The user can then click a button to display the picture in a pop-up window and also another button to email the potential...
7
6811
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 Inbox As Outlook.MAPIFolder Dim InboxItems As Outlook.Items Dim Mailobject As Object Set OlApp = CreateObject("Outlook.Application")
4
16706
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 11.0 from add ref. If you not find that, download the dll from here and install..click here open and windows application (or ASP.NET) in Form1 class code(declare) the following,
0
1616
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
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10303
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10282
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10061
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9111
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.