![]() |
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 |
Ads |
#2
|
|||
|
|||
![]()
It looks to me like you're making this too hard. Your code gets the IDs from the current folder, then gets the same current folder again using GetFolderFromID. Why not cut out the extra steps and just use:
pippo = CurExplorer.CurrentFolder.Items I've never heard of or seen a blank StoreID for any store. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "af2604" wrote in message ... Hi all. I'm trying to develop an AddIn using Visual Syudio 2008 Visual Basic, for Outlokk 2007. I'm able to detect the "SelectionChange" event for the current explorer, the program work fine, but the problem is that I have an IMAP account and so 2 different PST files : OUTLOOK.PST and IMAP.PST As soon as the program start it correctly detect that I'm working on the OUTLOOK.PST default file. But if I change selection and go in the "send folder" of Imap account I'm able to see the corrent user name : but I'M NOT ABLE TO DETECT THE CORRECT PST FILE. What I use to do this is : ----------------------------------------------------------------------- Public WithEvents CurExplorer As Outlook.Explorer Private Sub CurExplorer_Activate() Handles _ CurExplorer.SelectionChange Dim CurFldName As String Dim CurFldPath As String Dim CurUser As String Dim CurEntryId As String Dim CurStoreId As String Dim i As Integer CurUser = Me.Application.Session.CurrentUser.Address CurFldName = CurExplorer.CurrentFolder.Name CurFldPath = CurExplorer.CurrentFolder.Store.FilePath CurEntryId = CurExplorer.CurrentFolder.EntryID CurStoreId = CurExplorer.CurrentFolder.StoreID pippo = Me.Application.GetNamespace("MAPI"). _ GetFolderFromID(CurEntryId, CurStoreId).Items End Sub ------------------------------------------------------------------------ when I'm using OUTLOOK.PST file all is ok but when I select a IMAP folder the CurStoreId is always empty Any idea ? Alberto |
#3
|
|||
|
|||
![]()
Sue Mosher [MVP-Outlook] ha scritto:
It looks to me like you're making this too hard. Your code gets the IDs from the current folder, then gets the same current folder again using GetFolderFromID. Why not cut out the extra steps and just use: pippo = CurExplorer.CurrentFolder.Items I've never heard of or seen a blank StoreID for any store. I try to explain: 1) I activate an event trigger with "pippo" on the current folder 2) If the user changes the current folder I have to redirect "pippo" on an other folder so I have an event trigger also on CurExplorer the trigger starts when the user change folder better the folder is activated (from "Sent mail" to "incoming" and so on) 3) the istruction : CurFldName = CurExplorer.CurrentFolder.Name is only a debug I want to see the name of the new selected folder 4) to redirect pippo on the new folder items, with events, I have to use the istruction : pippo = Me.Application.GetNamespace("MAPI"). _ GetFolderFromID(CurEntryId, CurStoreId).Items now I have 2 email account on my outlook: 1) 2) with the first one is ALL ok CurFldName = "sent email" pippo detect event on this folder the problem is on the IMAP account CurFolder is correct but CurFldPath = CurExplorer.CurrentFolder.Store.FilePath is empty thanks for the anwer Alberto |
#4
|
|||
|
|||
![]()
af2604 ha scritto:
Sue Mosher [MVP-Outlook] ha scritto: It looks to me like you're making this too hard. Your code gets the IDs from the current folder, then gets the same current folder again using GetFolderFromID. Why not cut out the extra steps and just use: pippo = CurExplorer.CurrentFolder.Items I've never heard of or seen a blank StoreID for any store. I try to explain: 1) I activate an event trigger with "pippo" on the current folder 2) If the user changes the current folder I have to redirect "pippo" on an other folder so I have an event trigger also on CurExplorer the trigger starts when the user change folder better the folder is activated (from "Sent mail" to "incoming" and so on) 3) the istruction : CurFldName = CurExplorer.CurrentFolder.Name is only a debug I want to see the name of the new selected folder 4) to redirect pippo on the new folder items, with events, I have to use the istruction : pippo = Me.Application.GetNamespace("MAPI"). _ GetFolderFromID(CurEntryId, CurStoreId).Items now I have 2 email account on my outlook: 1) 2) with the first one is ALL ok CurFldName = "sent email" pippo detect event on this folder the problem is on the IMAP account CurFolder is correct but CurFldPath = CurExplorer.CurrentFolder.Store.FilePath is empty thanks for the anwer Alberto ERRATA CORRIGE: SOOOOORRY but when i select a folder of an IMAP account I STILL SEE the POP3 account sorry again why ? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
reinstalled OL- cannot change store or get previous store up | MikeR-Oz | Outlook - General Queries | 8 | May 19th 08 02:19 PM |
OE6 exporting messages problem: "default MAPI store could not be found" | Lanny Wolfe | Outlook Express | 6 | November 5th 07 08:16 AM |
IE6 'Store Folder' ... | Jim Hughes | Outlook Express | 4 | November 8th 06 04:41 AM |
"The specified default store could not be opened. Please make sure you can access your default store and try again." | [email protected] | Outlook - General Queries | 2 | February 17th 06 04:58 PM |
Problem Getting OE to Recognize Location of Store Folder | Bruce Kerievsky | Outlook Express | 5 | February 12th 06 01:39 AM |