473,385 Members | 1,813 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.

How to refrence the inbox of an additional mailbox in Outlook?

I have this code to get to the default Outlook inbox but I would like to get
to the inbox of an additional added mailbox. Can this be done? Here is the
code I'm using below:
Dim objSession As MAPI.Session

Dim objInbox As MAPI.Folder

Dim objMessages As MAPI.Messages

Dim objMessage As MAPI.Message

Dim objEmbeddedMessage As MAPI.Message

Dim objNewMail As MAPI.Message

If cboFileType.SelectedIndex <-1 Then

ListBox1.Items.Clear()

'create session and logon

objSession = CreateObject("MAPI.Session")

'Use this for non exchange outlook - objSession.Logon("Outlook")

objSession.Logon("Default Outlook Profile") 'works on Halliburton COE

' objSession.Logon()

'reference the messages in the inbox

objInbox = objSession.Inbox

objMessages = objInbox.Messages

--
Bill Bray
Mar 9 '08 #1
2 4575
at www.freevbcode.com they have some more examples..

I just know that in one of these methods you can rewrite
objInbox = objSession.Inbox

for each objInbox in objSession.Folders
Msgbox objInbox.Name
End if

It should be something like that; just iterate through the folders
until you see the folder name you want.. I am pretty sure that should
help, but YMMV

-Aaron

On Mar 8, 9:52*pm, "bill" <b...@bottlegarden.comwrote:
I have this code to get to the default Outlook inbox but I would like to get
to the inbox of an additional added mailbox. *Can this be done? *Here is the
code I'm using below:
Dim objSession As MAPI.Session

Dim objInbox As MAPI.Folder

Dim objMessages As MAPI.Messages

Dim objMessage As MAPI.Message

Dim objEmbeddedMessage As MAPI.Message

Dim objNewMail As MAPI.Message

If cboFileType.SelectedIndex <-1 Then

ListBox1.Items.Clear()

'create session and logon

objSession = CreateObject("MAPI.Session")

'Use this for non exchange outlook - objSession.Logon("Outlook")

objSession.Logon("Default Outlook Profile") 'works on Halliburton COE

' objSession.Logon()

'reference the messages in the inbox

objInbox = objSession.Inbox

objMessages = objInbox.Messages

--
Bill Bray
Mar 10 '08 #2
Thank you I will give that a shot!

<aa*********@gmail.comwrote in message
news:f3**********************************@u10g2000 prn.googlegroups.com...
at www.freevbcode.com they have some more examples..

I just know that in one of these methods you can rewrite
objInbox = objSession.Inbox

for each objInbox in objSession.Folders
Msgbox objInbox.Name
End if

It should be something like that; just iterate through the folders
until you see the folder name you want.. I am pretty sure that should
help, but YMMV

-Aaron

On Mar 8, 9:52 pm, "bill" <b...@bottlegarden.comwrote:
I have this code to get to the default Outlook inbox but I would like to
get
to the inbox of an additional added mailbox. Can this be done? Here is the
code I'm using below:
Dim objSession As MAPI.Session

Dim objInbox As MAPI.Folder

Dim objMessages As MAPI.Messages

Dim objMessage As MAPI.Message

Dim objEmbeddedMessage As MAPI.Message

Dim objNewMail As MAPI.Message

If cboFileType.SelectedIndex <-1 Then

ListBox1.Items.Clear()

'create session and logon

objSession = CreateObject("MAPI.Session")

'Use this for non exchange outlook - objSession.Logon("Outlook")

objSession.Logon("Default Outlook Profile") 'works on Halliburton COE

' objSession.Logon()

'reference the messages in the inbox

objInbox = objSession.Inbox

objMessages = objInbox.Messages

--
Bill Bray

Mar 11 '08 #3

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

Similar topics

0
by: Jason Ferree | last post by:
I posetd this in one group, but got no response, so I'll try it in this one. I am trying to loop through all messages in the inbox. To do something, in my case, look for and save attachments....
0
by: Keith | last post by:
A2k, Win XP Pro. I'm trying to follow this example in the MSKB: http://support.microsoft.com/default.aspx?scid=kb;en-us;209946&Product=acc2000 When I run the code I get the error "Error 3710...
5
by: Bob Dydd | last post by:
Hi Everybody I have an Access 2000 MDB with the Usual FrontEnd/BackEnd Arrangement. The program depends on being able link to "Inbox" in Ms Outlook 2000. This is easy enough to do from the...
2
by: Mikedi | last post by:
Hi. I use Exchange Server and I need to create a lot of rules to control my incomming mail. I also need be able to check my mailbox from any PC connected to the net. However there is only 32Kb of...
1
by: Roger | last post by:
I currently have an application that can monitor the Inbox of one mailbox running on a client using Outlook 2003. This is a standalone application that needs Outlook to be running in order to see...
2
by: Jason Ferree | last post by:
I am trying to loop through all messages in the inbox. To do something, in my case, look for and save attachments. It is telling me that items is not a collection. I've tried everything I can...
1
by: tom north | last post by:
What I am after would be a VB script perhaps using CDO to access the inbox of a mailbox, and push or pull messages in or out to a flat file directory on disk -- Tom North
0
by: Chicka | last post by:
I need/want to be able to send an email from a website running IIS and CDONTS for mail (or ASPMAIL) that comes into the inbox as an appointment to be accepted. The company is not running...
4
by: infomage27 | last post by:
I have tried scripting this with rules and VBA, now trying with C# but still failing. (code is exploratory, so please excuse the terribleness) maybe someone here will show me the error of my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.