Re: Name/number of Current Folder

Tech-Archive recommends: Fix windows errors by optimizing your registry



Sounds like you're looking for a Guid of some sort for language-insensitive
comparison. Unfortunately, as Sue mentioned there isn't one.

What you can do is use the GetDefaultFolder() method of the Namespace and
compare the EntryID of the MAPIFolder that it returns. If you're using VBA
you may just be able to compare the object references, but I'm using C# and
they tend to return different instances on each call.

Dim ns As Namespace
Dim currentFolder As MAPIFolder
Dim sentFolder As MAPIFolder

Set ns = Application.GetNamespace("MAPI")
Set currentFolder = Application.ActiveExplorer().CurrentFolder
Set sentFolder = ns.GetDefaultFolder(olFolderSentMail)

If currentFolder.EntryID = sentFolder.EntryID Then
....
End If

--
Josh Einstein
Tablet Enhancements for Outlook 2.0 - Try it free for 14 days
www.tabletoutlook.com

"????" <@discussions.microsoft.com> wrote in message
news:DC545EE7-947E-4BC2-A260-AF7D0A6C6CE8@xxxxxxxxxxxxxxxx
>
> Hello!
>
> I wrote the following line in a macro:
> Dim folderName As String
> folderName = Application.ActiveExplorer.CurrentFolder
>
> after running the line, I get the name of the Current Folder. I want the
> number of the folder, because people use different langueges in outlook,
> and
> the name "Inbox" or "Sent Items" is in different langueges by each user.
> How
> can I get the number of the folder instead of the name?
>
> Thanks,
> Yonina.
>


.



Relevant Pages

  • Re: Looping through Folders
    ... > SUBS to a specific folder thus making them more generic. ... > Dim appOutlook As Outlook.Application ... Return a MAPIFolder from Path argument ... >> Dim strDir As String ...
    (microsoft.public.outlook.program_vba)
  • Re: Ordner auflisten
    ... Sub ScanFolders(path As String, folder As MAPIFolder) ... Dim item As MAPIFolder ... On Error GoTo quit ...
    (microsoft.public.de.outlook)
  • RE: Outlook Intergration
    ... Here I understood you means the contact item in the Contact Folder in ... Dim mf As MAPIFolder ... Dim ci As ContactItem ... shot about what is the outlook contact list you are working on? ...
    (microsoft.public.office.developer.office.sdks)
  • Re: Execute macro for all documents in the folder
    ... It is simple enough to batch process a single folder. ... Dim strFileName As String ... It seems as though the below macro from an earlier posting was put ...
    (microsoft.public.word.docmanagement)
  • Re: Execute macro for all documents in the folder
    ... It is simple enough to batch process a single folder. ... Dim strFileName As String ... It seems as though the below macro from an earlier posting was put ...
    (microsoft.public.word.docmanagement)