![]() |
|
#1
|
|||
|
|||
|
Hi,
I have a macro accessing the emails in the Outlook_inbox and parsing them to identify a specific one and process it. Currently, I'm using the constant > olFolderInbox < (corresponding to the nr. 6) to specify the Inbox. => Is there a way to specify another folder (in this case that would be a subfolder that we created in the Inbox? Thanks a lot! Best regards, Officer_Bierschnitt |
|
#2
|
|||
|
|||
|
Hi,
there is another problem leading back to this one: The guys in the dpt. where that macro is supposed to run all have two inboxes: The personal one and a team_inbox. When I ran a code that I found online to test for the ID of Outlook_sessions and display it in a MsgBox, however, only one session was found. Thus, I cannot have them run the macro unless someone logs on to the team_account. It would be much more practical, however, if I was able to specify that the macro should not search the personal inbox, but the team_inbox. I just don't know how to find out the constant I have to use to do so. Can anybody help me with that? Thanks a lot! Best regards, Officer_Bierschnitt |
|
#3
|
|||
|
|||
|
HI,
As before I don have Outlook. But, See if this code helps. Code:
Sub launchpad()
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim MyFolder As Outlook.MAPIFolder
On Error Resume Next
Set olApp = Outlook.Application
Set objNS = olApp.GetNamespace("MAPI")
Set MyFolder = objNS.PickFolder
Call ProcessFolder(MyFolder)
Set objNS = Nothing
Set MyFolder = Nothing
Set olApp = Nothing
Set objNS = Nothing
End Sub
Sub ProcessFolder(StartFolder As MAPIFolder)
Dim objFolder As Outlook.MAPIFolder
Dim objItem As Object
Dim mai As mailitem
On Error Resume Next
' MsgBox StartFolder.Path, , "testing"
' process all the items in this folder
' For Each objItem In StartFolder.Items
' If TypeName(objItem) = "MailItem" Then
' Set mai = objItem
' End If
' Next
' process all the subfolders of this folder
For Each objFolder In StartFolder.Folders
Call ProcessFolder(objFolder)
Next
Set mai = Nothing
Set objFolder = Nothing
Set objItem = Nothing
End Sub
|
|
#4
|
|||
|
|||
|
Cant see quite what you are trying to do, but attach the code and fixing it should be simple
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Outlook Junk folder missing emails since 2/24/2015 | rasmasyean | Outlook | 0 | 03-03-2015 04:28 PM |
| Show emails stored in a system folder (drive) in outlook | megatronixs | Outlook | 3 | 10-28-2014 10:47 PM |
Outlook VBA rule to search email attachements and move the emails into a folder
|
genius7 | Outlook | 6 | 09-09-2014 07:01 AM |
| outlook "Unread Email" folder automaticaly reads then dissapears emails | michaelrj9 | Office | 0 | 08-20-2010 03:59 PM |
Is someone accessing my emails?
|
Bitbat | Outlook | 2 | 08-04-2010 04:30 AM |