![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi VBA Friends,
I am trying in VBA to select an already created folder "createdFolder" which has mail items in it. What I want to do is reference the "createdFolder" and display all the mail items contained within it, using a for each or a do until There are numerous posts which I have been looking at and I think what I need to do is reference the "createdFolder" using GetNamespace method? Can anyone help please?? Many thanks Scott Spence |
Ads |
#2
|
|||
|
|||
![]()
If you know the location of the folder, you can access it fairly easily in
reference to a default folder: Set myFolder = objInbox.Folders("MY SUBFOLDER") Use the NameSpace.GetDefaultFolder method to return various default folders. If you don't know the location, one way is to iterate through all of the folders: http://www.outlookcode.com/codedetail.aspx?id=1639 You can display a specific folder using the Explorer.CurrentFolder property or the Explorer.SelectFolder method. You don't need to loop through individual items in a folder to display it - they'll all display automatically based on the last selected (or the default) View. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: Hi VBA Friends, I am trying in VBA to select an already created folder "createdFolder" which has mail items in it. What I want to do is reference the "createdFolder" and display all the mail items contained within it, using a for each or a do until There are numerous posts which I have been looking at and I think what I need to do is reference the "createdFolder" using GetNamespace method? Can anyone help please?? Many thanks Scott Spence |
#3
|
|||
|
|||
![]()
Hi Eric,
Thanks for getting back to me, I am really struggling with qualifying the objects. I know what the folder name is, I found a really useful piece of code that moves all the items from the drafts folder to an outbox subfolder that creates the subfolder if it is not detected and moves all the draft items into it. The thing is that I want to open/display all the items that have been moved to this folder. Can you tell me what "myFolder" and "objInbox" have been defined in memory as? Eric Legault [ MVP - Outlook ] wrote: If you know the location of the folder, you can access it fairly easily in reference to a default folder: Set myFolder = objInbox.Folders("MY SUBFOLDER") Use the NameSpace.GetDefaultFolder method to return various default folders. If you don't know the location, one way is to iterate through all of the folders: http://www.outlookcode.com/codedetail.aspx?id=1639 You can display a specific folder using the Explorer.CurrentFolder property or the Explorer.SelectFolder method. You don't need to loop through individual items in a folder to display it - they'll all display automatically based on the last selected (or the default) View. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: Hi VBA Friends, I am trying in VBA to select an already created folder "createdFolder" which has mail items in it. What I want to do is reference the "createdFolder" and display all the mail items contained within it, using a for each or a do until There are numerous posts which I have been looking at and I think what I need to do is reference the "createdFolder" using GetNamespace method? Can anyone help please?? Many thanks Scott Spence |
#4
|
|||
|
|||
![]()
Hi Eric,
Thanks for getting back to me, I am really struggling with qualifying the objects. I know what the folder name is, I found a really useful piece of code that moves all the items from the drafts folder to an outbox subfolder that creates the subfolder if it is not detected and moves all the draft items into it. The thing is that I want to open/display all the items that have been moved to this folder. Can you tell me what "myFolder" and "objInbox" have been defined in memory as? Scott Eric Legault [ MVP - Outlook ] wrote: If you know the location of the folder, you can access it fairly easily in reference to a default folder: Set myFolder = objInbox.Folders("MY SUBFOLDER") Use the NameSpace.GetDefaultFolder method to return various default folders. If you don't know the location, one way is to iterate through all of the folders: http://www.outlookcode.com/codedetail.aspx?id=1639 You can display a specific folder using the Explorer.CurrentFolder property or the Explorer.SelectFolder method. You don't need to loop through individual items in a folder to display it - they'll all display automatically based on the last selected (or the default) View. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: Hi VBA Friends, I am trying in VBA to select an already created folder "createdFolder" which has mail items in it. What I want to do is reference the "createdFolder" and display all the mail items contained within it, using a for each or a do until There are numerous posts which I have been looking at and I think what I need to do is reference the "createdFolder" using GetNamespace method? Can anyone help please?? Many thanks Scott Spence |
#5
|
|||
|
|||
![]()
Those variables are declared as Outlook.MAPIFolder objects. Always make sure
you check the Outlook VBA help file - it's full of helpful code samples. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: Hi Eric, Thanks for getting back to me, I am really struggling with qualifying the objects. I know what the folder name is, I found a really useful piece of code that moves all the items from the drafts folder to an outbox subfolder that creates the subfolder if it is not detected and moves all the draft items into it. The thing is that I want to open/display all the items that have been moved to this folder. Can you tell me what "myFolder" and "objInbox" have been defined in memory as? Eric Legault [ MVP - Outlook ] wrote: If you know the location of the folder, you can access it fairly easily in reference to a default folder: Set myFolder = objInbox.Folders("MY SUBFOLDER") Use the NameSpace.GetDefaultFolder method to return various default folders. If you don't know the location, one way is to iterate through all of the folders: http://www.outlookcode.com/codedetail.aspx?id=1639 You can display a specific folder using the Explorer.CurrentFolder property or the Explorer.SelectFolder method. You don't need to loop through individual items in a folder to display it - they'll all display automatically based on the last selected (or the default) View. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: Hi VBA Friends, I am trying in VBA to select an already created folder "createdFolder" which has mail items in it. What I want to do is reference the "createdFolder" and display all the mail items contained within it, using a for each or a do until There are numerous posts which I have been looking at and I think what I need to do is reference the "createdFolder" using GetNamespace method? Can anyone help please?? Many thanks Scott Spence |
#6
|
|||
|
|||
![]()
Hi Gary. See my blog for a walkthrough on wiring up Outlook to handle e-mail
events: Eric Legault My Eggo : Getting a Handle on Your E-mails with VBA: http://blogs.officezealot.com/legault/pages/20086.aspx -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: Hi Eric, Thanks for getting back to me, I am really struggling with qualifying the objects. I know what the folder name is, I found a really useful piece of code that moves all the items from the drafts folder to an outbox subfolder that creates the subfolder if it is not detected and moves all the draft items into it. The thing is that I want to open/display all the items that have been moved to this folder. Can you tell me what "myFolder" and "objInbox" have been defined in memory as? Eric Legault [ MVP - Outlook ] wrote: If you know the location of the folder, you can access it fairly easily in reference to a default folder: Set myFolder = objInbox.Folders("MY SUBFOLDER") Use the NameSpace.GetDefaultFolder method to return various default folders. If you don't know the location, one way is to iterate through all of the folders: http://www.outlookcode.com/codedetail.aspx?id=1639 You can display a specific folder using the Explorer.CurrentFolder property or the Explorer.SelectFolder method. You don't need to loop through individual items in a folder to display it - they'll all display automatically based on the last selected (or the default) View. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ " wrote: Hi VBA Friends, I am trying in VBA to select an already created folder "createdFolder" which has mail items in it. What I want to do is reference the "createdFolder" and display all the mail items contained within it, using a for each or a do until There are numerous posts which I have been looking at and I think what I need to do is reference the "createdFolder" using GetNamespace method? Can anyone help please?? Many thanks Scott Spence |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook 2003 Script: How to get the Index or number of items in a Folder | news.microsoft.com | Outlook and VBA | 5 | November 6th 06 10:11 PM |
Sent Items"Unable to display the folder" | [email protected] | Outlook - General Queries | 5 | October 4th 06 02:19 PM |
How to update sent items on IMAP Folder on server using Outlook 2003 ? | Luqman | Outlook - General Queries | 0 | September 4th 06 09:42 PM |
how to retain 10 days items in Outlook 2003 deleted items folder? | Balthazar | Outlook - Installation | 2 | June 7th 06 04:05 PM |
Display Recvd and Sent Items in Same folder? | Phill | Outlook - Using Contacts | 1 | June 6th 06 10:11 PM |