![]() |
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,
I already know excel VBA but I am trying to programmically access Outlook from Excel. I have a few questions: i managed to access my main inbox that on this location: personal folders Inbox how do i access in VBA another folder that's on the same level as "personal folders". for example, the archive folders or another main folder i created on that level. do give you an idea what i mean, this would be the xml-style structu personal folders folder x inbox /personal folders main folder folder i would like to access folder 1 /main folder - how do i send email from another account than the standard email account? on www.outlookcode.com i found a book that might help me. Is it usefull? I use office 2003 so i would rather have a book on outlook 2003 vba exclusively. Is there such a book or is the book on outlookcode (2002 version) the onlye available book? kind regards, Tamar |
#2
|
|||
|
|||
![]()
Every .pst or top-level store in Outlook is also an entry in the top-level
folders collection that you can retrieve from NameSpace.Folders. So to get your "Personal Folders" store, you'd call: Dim objNS As Namespace Dim objMyFolders As Folders Dim objMyTopLevelFolder As MAPIFolder Set objNS = Application.GetNamespace("MAPI") Set objMyFolders = objNS.Folders("Personal Folders") Set objMyTopLevelFolder = objMyFolders("Inbox") As for choosing the e-mail account to send the message with, there is no point checking to see if an account hasn't been chosen because the default account is always used if no other account is selected. The only way to programmatically set the sending account is to get a reference to the menu item and call it's Execute method (however, you need to know the name or ordinal position of the account name in the menu): Sub ChangeSendingAccount() Dim objCBPU As Office.CommandBarPopup Dim objCBB As Office.CommandBarButton Set objCBPU = ActiveInspector.CommandBars.FindControl(, 31224) 'get Accounts button on Standard toolbar 'Get menu item by name or index number Set objCBB = objCBPU.Controls.Item("&1 Microsoft Exchange Server") 'Set objCBB = objCBPU.Controls.Item(2) objCBB.Execute Set objCBPU = Nothing Set objCBB = Nothing End Sub And yes, that book on Outlookcode.com is the best for you, and is applicable for programming with Outlook 2000-2003. -- 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/ "Tamar" wrote: Hi, I already know excel VBA but I am trying to programmically access Outlook from Excel. I have a few questions: i managed to access my main inbox that on this location: personal folders Inbox how do i access in VBA another folder that's on the same level as "personal folders". for example, the archive folders or another main folder i created on that level. do give you an idea what i mean, this would be the xml-style structu personal folders folder x inbox /personal folders main folder folder i would like to access folder 1 /main folder - how do i send email from another account than the standard email account? on www.outlookcode.com i found a book that might help me. Is it usefull? I use office 2003 so i would rather have a book on outlook 2003 vba exclusively. Is there such a book or is the book on outlookcode (2002 version) the onlye available book? kind regards, Tamar |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Access to OST folder when online | Meex | Outlook and VBA | 1 | March 8th 07 02:38 PM |
How to know if can I access a folder ? | Gianluigi Rubino | Outlook and VBA | 1 | September 1st 06 07:23 PM |
"Unable to display the folder. Microsoft Outlook could not access the specified folder location." | jw | Outlook - General Queries | 0 | July 21st 06 04:41 PM |
"Unable to display the folder. Microsoft Outlook could not access the specified folder location." | jw | Outlook - Calandaring | 0 | July 21st 06 04:40 PM |
"Unable to display the folder. Microsoft Outlook could not access the specified folder location." | jw | Outlook - Installation | 0 | July 21st 06 04:40 PM |