msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GetDefaultFolder(olFolderInbox) question

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook
Author Message
landau



Joined: 06 Feb 2008
Posts: 12

PostPosted: Wed Feb 13, 2008 2:29 am    Post subject: GetDefaultFolder(olFolderInbox) question Reply with quote

So I'm almost done with my VBA code... my routine sets a private to my
default Inbox (as per the title of this post) and in my routine, I
check to make sure the current Explorer is in my default Inbox or else
I don't want my macro executing. Here's the test:

At Application launch: Set myOlDefaultInboxFolder =
myNameSpace.GetDefaultFolder(olFolderInbox)

In my macro: If (Application.ActiveExplorer.CurrentFolder =
myOlDefaultInboxFolder) Then

I'm finding that when I switch folders to my other email account's
INBOX, the above test returns true. As a matter of fact, the above
test returns true for any folder called "inbox"... even if it is in a
PST file.

Does this sound right? Is there a way to test to see if the current
explorer's folder is in the default mailbox ?

Thanks
-Ed

Archived from group: microsoft>public>office>developer>outlook>vba
Back to top
View user's profile Send private message
Michael Bauer [MVP - Outl



Joined: 12 Aug 2007
Posts: 92

PostPosted: Wed Feb 13, 2008 12:04 pm    Post subject: Re: GetDefaultFolder(olFolderInbox) question Reply with quote

You cannot compare objects in that way. For Outlook folders, compare their
EntryIDs.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:


Am Tue, 12 Feb 2008 21:29:45 -0800 (PST) schrieb landau@skiz.net:

> So I'm almost done with my VBA code... my routine sets a private to my
> default Inbox (as per the title of this post) and in my routine, I
> check to make sure the current Explorer is in my default Inbox or else
> I don't want my macro executing. Here's the test:
>
> At Application launch: Set myOlDefaultInboxFolder =
> myNameSpace.GetDefaultFolder(olFolderInbox)
>
> In my macro: If (Application.ActiveExplorer.CurrentFolder =
> myOlDefaultInboxFolder) Then
>
> I'm finding that when I switch folders to my other email account's
> INBOX, the above test returns true. As a matter of fact, the above
> test returns true for any folder called "inbox"... even if it is in a
> PST file.
>
> Does this sound right? Is there a way to test to see if the current
> explorer's folder is in the default mailbox ?
>
> Thanks
> -Ed
Back to top
View user's profile Send private message
landau



Joined: 06 Feb 2008
Posts: 12

PostPosted: Wed Feb 13, 2008 4:47 am    Post subject: Re: GetDefaultFolder(olFolderInbox) question Reply with quote

Awesome. Thanks so much !

-Ed

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Easy Question I hope... Thanks in advance for any help... I am an extreme novice VBA coder... I have a custom form of contacts containing a custom field that contains a dollar amount. After defining a certain view, I would like to create a macro to give me pop-up box displaying

Email housekeeping: A question for Sue..... Dear Sue, as you have read I've been arguing often about Outlook's RW capabilities. As a result I was thinking what is your advice to implement an effective strategy to store emails in their respective folders. This is the scenario: I have a local .pst co

Redemption MAPITable Question Well, this seems like it should be simple. So, I assume I'm overlooking something small. Here's my code: Public Sub Dim oRecordset As Object Dim oTable As Object Set oTable = oTable.item = Outlook.Sess

Question about European Office versions (language issues) Are specific versions of MS Office for different European languages marketed, or does the MS Office installer just copy language modules based on the version of Windows installed? I need to know if there is a way to detect the Office language version or i

Question I'm not sure whether I have a Vista problem, or a Windows Mail problem, a registry problem, or a bug in a particular app. The situation is that when I try to email a photograph from Paint Shop Pro Photo X2, I receive an Outlook error message stating "No
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group